Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Syntax of setting Ref Cursor in procedure from JDBC
Hi,
I am calling a SP from java. Now the problem is that the SP has 3 Parameters- :
2 IN String variables
1 IN OUT variable which is a REF CURSOR
Java Code
String cmrQuery="{call cust_db.get_cntr_num_sp(?,?,?)}"; <<--IS SYNTAX CORRECT
cstmt = con.prepareCall(cmrQuery); cstmt.setQueryTimeout(QUERY_TIMEOUT) ; cstmt.setString(1,mcn_base); cstmt.setString(2,mcn_sfx);cstmt.setString(3,NULL); <<-- PROBLEM IS HERE cstmt.registerOutParameter(1, OracleTypes.CURSOR); rs =cstmt.executeQuery();
SO now my question is -:
Any help or clarification will be highly helpful.. I have been banging my head on this one for some time now..
Thanks in advance
atul
Received on Sun Nov 28 2004 - 07:22:08 CST