Home » SQL & PL/SQL » SQL & PL/SQL » jdbc oracle function connectivity
jdbc oracle function connectivity [message #619] Mon, 25 February 2002 01:35 Go to next message
Lalit
Messages: 7
Registered: February 2002
Junior Member
Can any body help me debugging this code where i want to get a parameter out of the function PUT_USERS
in case of procedure it is working perfectly but there are problems for function.
Thanks in Advance.
Lalit
Hyd.
India.

dbConn.setAutoCommit(true);
CallableStatement cs = dbConn.prepareCall("{call ? := PUT_USERS(?,?,?,?) }");
cs.registerOutParameter(1,Types.VARCHAR);

cs.setString(1,mailId);
cs.registerOutParameter(2,Types.VARCHAR);
cs.setString(2,siteName);
cs.registerOutParameter(3,Types.INTEGER);
cs.setInt(3,frequency);
cs.registerOutParameter(4,Types.FLOAT);
cs.setFloat(4,offset);
//cs.getInt(1);
cs.executeUpdate();
//int result =((OracleCallableStatement)cs).getInt(1);
int result = cs.getInt(1);
System.out.println("result is: " + result + "n");
//int reply = cs.getInt(1);
//out.println("this is the reply " + reply);
cs.close();
Re: jdbc oracle function connectivity [message #623 is a reply to message #619] Mon, 25 February 2002 01:51 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
function can not have outparameter and it can only return one value.chanege your code accordingly
Re: jdbc oracle function connectivity [message #632 is a reply to message #619] Mon, 25 February 2002 03:53 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
Question:
if i have code like this
?:=call(?,?,?,?)
then the first parameter ? that is the returned value
is a outparameter and it will contain the value am i incorrect.

Answer:
yes you are correct.
Previous Topic: Text Box Validation Using a Trigger
Next Topic: Re:V$Open_Cursors to detect Open Cursors at Runtime
Goto Forum:
  


Current Time: Thu Apr 25 03:46:25 CDT 2024