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

Column index x is out of range SQLException

0 views
Skip to first unread message

Jeff

unread,
May 2, 2002, 3:42:53 PM5/2/02
to
I just downloaded Microsoft's released JDBC driver and replaced it
where I was using their Beta 2 driver before.

After replacing the driver, I'm getting the following exception:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Column index 9 is out of range.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown
Source)
at com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown
Source)
at com.microsoft.jdbc.base.BaseResultSet.getString(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.getString(Unknown Source)

It seems like all of my code to update rows using a ResultSet directly
using the updateXXXX() methods all give me this error with difference
column index numbers. This doesn't happen using the Beta 2 version.

I looked at the release notes and noticed something interesting:
To perform an update on a ResultSet, the ResultSet must include a
searchable column, to determine if a column is searchable you can use
the ResultSetMetaData.isSearchable() method.

Is that something new that was introduced in the final version? And
what exactly is it? The Java javadocs is not very specific about it.

My select statement was: SELECT contact.* FROM contacts where id = 5

Thanks,

Jeff

unread,
May 3, 2002, 1:34:24 PM5/3/02
to
Some updates to this problem.

I found out that the released MS JDBC driver doesn't handle
"SELECT table.* FROM table" properly. It only returns 1 column and
hence I get Column index out of range.

But if I use "SELECT * FROM table" the result set has the proper
number of columns.

Does anyone know why the released version does that and not the beta?
Non of the other driver's seem to have this problem either.

Thanks,

ze...@yahoo.com (Jeff) wrote in message news:<371274b5.02050...@posting.google.com>...

0 new messages