Invalid Descriptor Index Solution
843810Sep 26 2002 — edited Jun 25 2003Java Programmers,
I just wanted to share a problem with you and my answer to the problem in hope that it saves you time. It took me about an hour to figure out what was going on. The problem and answer is below.
PROBLEM:
-----------------------------------------------------------------
This error keeps occuring whenever I try to access data from a ResultSet.
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataFloat(JdbcOdbc.java:3136)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataFloat blah blah blah
ANSWER TO PROBLEM:
------------------------
Unfortanetly, if you don't access your fields in order as they appear in the database you will get this error even if your descriptor is correct.
Hope this helps somebody,
Bruce