File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes jdbc error: Invalid Descriptor Index Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jdbc error: Invalid Descriptor Index" Watch "jdbc error: Invalid Descriptor Index" New topic

jdbc error: Invalid Descriptor Index

Rathi Sethuraman

Joined: May 14, 2004
Posts: 3
Is there any odbc expert out there? I have a java class thru which i access the backend and retrieve a set of records. The table has a column by the name "vol_no" and is of char type. But whenever i access it through


It gives the following error...

java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
at sun.jdbc.odbc.JdbcOdbc.createSQLException(
at sun.jdbc.odbc.JdbcOdbc.standardError(
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(

what is wrong???
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
This type of error mostly occur when you try to get the value of a column of Database twice using JDBC ODBC.

This is error is occuring because you are calling rs.getString("vol_no") twice in your code.

You can store the value of this column in some variable and then use it like

String val = rs.getString("vol_no");
//use val any where instead of using rs.getString("vol_no") repeatedly.

If this is not the problem then post your code.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Moving this to the more appropriate JDBC forum. This forum is for Servlets questions.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: jdbc error: Invalid Descriptor Index
jQuery in Action, 3rd edition