aspose file tools*
The moose likes JDBC and the fly likes [Resolved] Oracle CallableStatement Invalid Index Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "[Resolved] Oracle CallableStatement Invalid Index" Watch "[Resolved] Oracle CallableStatement Invalid Index" New topic
Author

[Resolved] Oracle CallableStatement Invalid Index

Henry Lowell
Ranch Hand

Joined: May 29, 2006
Posts: 63
I've ran the stored procedure from sql+ and it runs just fine. I am trying to run it with JDBC and I am getting an Invalid Index exception when I try and get the CURSOR object out of the statement.



Like I said, running the sp on the console, I get data back so I know it should be returning something. But it says my index is invalid. Any clues? I have the same code running other stored procedures and they are working fine.

Thanks.
[ June 02, 2006: Message edited by: Henry Lowell ]

Hank
Henry Lowell
Ranch Hand

Joined: May 29, 2006
Posts: 63
What's interesting about this problem is that I have the exact same java code for running a different Stored Procedure and it works just fine. The only difference is it only has an OUT parameter, no IN parameters at all.

Still baffled.
Henry Lowell
Ranch Hand

Joined: May 29, 2006
Posts: 63
I figured it out. The index that you specify on getObject() has to be the same index as you used in the registerOutParameter(). So doing getObject(4) works.
[ June 02, 2006: Message edited by: Henry Lowell ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Resolved] Oracle CallableStatement Invalid Index