Some database drivers might require that you access columns in the resultset in an increasing order. My suggestion would be either to read all columns into local variables incrementally and then to process them, or (perhaps better) use a Java library to read Excel files (such as Apache POI or jExcel API) instead of ODBC.
And welcome to the Ranch!
Joined: Oct 13, 2005
Please use the code button and avoid long lines; I have applied the code button to your post and you can see how much better it looks. On this forum (JDBC) only, you may have to disable smilies otherwise :odbc appears as dbc!