Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

invalid descriptor index with MS SQL server, ODBC driver and JDBC-ODBC Bridge

3 views
Skip to first unread message

Jarkko Viinamäki

unread,
Jul 5, 1999, 3:00:00 AM7/5/99
to
Hi,

I have been developing Java-based solutions with MS SQL server, ODBC driver
for MSSQL and JDBC-ODBC bridge. There is one especially annoying 'feature'
for which I'd hope to find an elegant workaround. Let's
suppose I have a table MyData with columns AA,BB,CC,DD.
I then do:

ResultSet rs = javaConnectionObject.executeQuery("select AA,BB,CC,DD from
MyData");
rs.readString("AA");
rs.readString("CC");
rs.readString("BB"); // here I get an java.sql.Exception: Invalid descriptor
index

This is most obviously due to the fact that the 'cursor' has moved past
column BB when column CC is read and it's unable to go back. This is very
annoying since I have huge queries with 40+ columns which I want to process
as efficiently as possible in my Java code. Of course, I could read them all
in specified order and store the values to local variables but that would be
awful waste of time. Any suggestions how to do this elegantly? Thanks.

++Jarkko

joh...@my-deja.com

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to
We just made the move from using Access97 for
unit testing to SQLServer. I hit the same error
trying to access a TEXT data type field in my
result set. It appears that in the SELECT
statement, all TEXT fields have to be listed
last. I haven't found a good explanation why,
but it works.

Todd Johnson


In article <nL2g3.155$9V2...@read2.inet.fi>,
"Jarkko Viinamäki"

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

0 new messages