Generic-user-small 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 "${it.name}\t\t${it.abbreviation}" 
  groovy> }

  Exception thrown: java.sql.SQLException: No suitable driver

  java.sql.SQLException: No suitable driver
    at Script10.run(Script10:1)

I must need to install a driver of some sort?

thanks,
Eric

 
Venkatsubramaniam_small Venkat Subra... 52 posts

Eric,

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.

 
Generic-user-small 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.

 
Generic-user-small Fred Miller 2 posts

Using http://poi.apache.org as a model.

4 posts, 3 voices