Hi,
Thanks for ur reply. I tried it. But, it seems i cant call a function using callable statement. Bcos, it gave the error as
********************************************************
java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00221: 'MYRECRTN' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
*********************************************************
I have declared and defined MYRECRTN as function inside mypackage. I prepared the callable statement using "{call mypackage.myrecrtn()}".
Is there any other way to call a function from
java???
Thanks in advance,
Sankar
Originally posted by Himanshu Khanna:
find following dummy code snippet if useful to u..
String strFunName = {?=call(?....?)}
where first ? is for return value and
second ? is for parameter u passed it can be any no.
now call the prepareCall method of con like in following steps
1) CallableStatement cStmt = con.prepareCall(strFunName );
2) cStmt.setXXX(parameterValue);
3) cStmt.registerOutParameter(1, Types.NUMERIC)
4) cStmt.executeUpdate();
5) if the return type is int..
int value = cStmt.getInt(1);
thats it