Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC / JSP / Oracle Stored procs problem.

 
Rob Earls
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to call a PLSQL which has two arguments. First is an "OUT", and the second is an "IN" variable.
Encrypt(cryptpass, input) - No return value.
You pass it "input", and it passes back "cryptpass".
How can I get access to "cryptpass" via JDBC ( in java/JSP )
( This is a simple example, a lot of other stored procedures have more than one "return" value )
 
shilpa kulkarni
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After callablestat.execute() -
For a single or multiple values being returned by stored procedures as OUT parameters, use :
String cryptPass = callablestat.getString(1);
int resultInt = callablestat.getInt(n);
etc.
If the stored procedure is returning a cursor, use :
ResultSet rst = ((OracleCallableStatement)callablestat).getCursor(3);
and then : rst.get.....
 
Rob Earls
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic