small medium large xlarge

03 Nov 2008, 22:38
Eric Blossom (1 post)

Trying to follow the example on page 163 I get:

  groovy> def sql = groovy.sql.Sql.newInstance("""
  groovy> jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};
  groovy> DBQ=C:/Documents and Settings/me/AssayDB.xls;READONLY=false""", '', '')
  groovy> println "000"
  groovy> sql.eachrow('SELECT * FROM [Substrates$]') {
  groovy>     println "${}\t\t${it.abbreviation}"
  groovy> }
  Exception thrown: java.sql.SQLException: No suitable driver

  java.sql.SQLException: No suitable driver

I must need to install a driver of some sort?

thanks, Eric

04 Nov 2008, 22:38
Venkat Subramaniam (99 posts)


Can you go into Control Panel and Data Sources(ODBC) and see if Microsoft Excel Driver is installed. If you find it, try using the exact name as it appears in that panel (including the items in the parenthesis). Let me know what you find.

03 Feb 2010, 13:45
Fred Miller (2 posts)

I have some Excel spreadsheets in a Unix/Linux environment and I’d like to use Groovy to read and convert the contents to XML. Any recommendations? Looking mainly at the cleanest way to read an Excel file in Unix/Linux. I’m ok with the XML conversion just added it for context.

03 Feb 2010, 15:07
Fred Miller (2 posts)

Using as a model.

26 Apr 2010, 20:47
Angel Villafranca (1 post)

Hi Eric, I got your piece of code to work by adding ‘sun.jdbc.odbc.JdbcOdbcDriver’ as 4th parameter to your call to Sql.newInstance()

def sql = groovy.sql.Sql.newInstance(“"”jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)}; DBQ=C:/MyDataFile.xls;READONLY=false”””, ‘’, ‘’, ‘sun.jdbc.odbc.JdbcOdbcDriver’)

You must be logged in to comment