This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
Similar Threads
Callign an oragle package in Java with JDBC
Stored procedure which returns array
Oracle stored procedure trouble
Webapp hang when calling stored procedure
Calling Oracle stored procedures in JRun container