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 Invalid column 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
Reply locked New topic

Invalid column index

Aabha Varma

Joined: Jan 12, 2005
Posts: 22
I have written a procedure that returns me Ref cursor.
the object that i am returning is a table of records that have two columns. Both the record and the table is created permanently in db.

I am calling the procedure from java.
The procedure when run separately, gives me two rows with value.

Now when i take a result set of the cursor, and if i give rs.getInt(column name) it gives me an invalid column index.

But the resultset meta data gives me the information that there are two columns.
So now i am stuck as where to debug.

Can anybody help me out

Thanks in advance
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63854

"Aabha MMT",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Hi check my reply .here.

Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
I agree. Here's the link:
subject: Invalid column index
It's not a secret anymore!