Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Resolved] Oracle CallableStatement Invalid Index

 
Henry Lowell
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Henry Lowell
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic