Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling oracle stored proc from java

Status
Not open for further replies.

redsss

Programmer
Joined
Mar 17, 2004
Messages
72
Location
US
I am calling an Oracle stored procedure from java and need to retrieve the numeric value returned as an OUT parameter..

Code:
PROCEDURE myproc (n_retval OUT NUMBER)

I'm trying something like this. What am I missing?
Code:
cstmt = gps.prepareCall("{ call myproc(?)}");
cstmt.registerOutParameter(1, OracleTypes.NUMBER);
cstmt.execute();

int n_ret = (int)oracle.sql.NUMBER(cstmt.getObject(1));

 
I would have the last line like :

Code:
int ret = cstmt.getInt(1);

What errors are you seeing ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top