Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I call CallableStatement .getObject(int)

 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I caught an "SQLException: Invalid column index" from the following code and was wondering whether someone would know can I call CallableStatement.getObject(int) in the first place? (the javadocs don't say anything about not being allowed to call that)

The stack trace looks like this:

Have I understood the meaning of CallableStatement.getObject(int) wrong? Is it supposed to return the parameter set with the corresponding setXXX(int) method or is it supposed to return one of the return values of the stored procedure? If it's the latter, then is there any other way of getting the parameters out of the CallableStatement once they've been set?
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to do a registerOutputParameter() first. Post the header of your pl/sql proceedure if that doesn't work (I imagine in/out might be the problem if you already do that).
Simon
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Simon. Unfortunately I can't use the registerOutParameter(...) method so I'll have to resort to some other means...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic