I have written a Stored Procedure as shown , which will be responsible to give the
list of the EMployee Numbers
create or replace procedure
kiran
as
CURSOR cur is select * from emp;
TEMPCUR cur%rowtype;
begin
open cur;
loop
fetch cur into TEMPCUR;
DBMS_OUTPUT.PUT_LINE(TEMPCUR.empno);
exit when cur%NOTFOUND;
end loop;
close cur;
end;
/
Please tell me how can i retrive this values from a JDBC program
callableStatement = dbConnection.prepareCall(kiran);
// Please help need logic here
Here’s how you do it. Remember, the last parameter in my example is actually declared in the PL/SQL procedure as an “OUT” parameter, e.g. the value you want to return in the form of a parameter):
conn — is the connection object
cstmt — this is a callablestatement