Help me in calling stored procedure and getting results

Advertisement

Help me in calling stored procedure and getting results
hi
i have a SP like this
CREATE OR REPLACE PACKAGE P1 AS
TYPE g_con_ref_cursor is REF CURSOR ;
TYPE g_con_error IS RECORD
  error_code NUMBER,
  error_desc varchar2(2000)
PROCEDURE PROC_CURSOR
(i_str_userid  IN VARCHAR2,
  o_cur_ref_cur OUT g_con_ref_cursor,
  o_rec_error   OUT g_con_error,
  o_num_status  OUT NUMBER);
END;
and i now i am trying to call this SP using my java program
i am able to register the out put params for 2nd and 4 th variable
my doubt is how i can register the output param for g_con_errorand how i can get result from this ????
my java program is like this
Connection connection = DatabaseHelper.prepareConnection();
CallableStatement proc = connection.prepareCall("{ call P1.PROC_CURSOR(?, ?, ?, ?) }");
proc.setString(1,"jn26557");
proc.registerOutParameter(2,oracle.jdbc.driver.OracleTypes.CURSOR);
proc.registerOutParameter(3,Types.STRUCT,); //HOW TO SET  THIS ?????
proc.registerOutParameter(4,oracle.jdbc.driver.OracleTypes.NUMERIC);
proc.execute();
plz help me in this
i have no idea how to do it
any help would be appreciated
Thanks in advance
Jaya Prakash Nalajala
Repaly
You have the requirements to build the stored procedure, what have you got so far?
Post your attempt and any errors or issues that you might be experiencing. Writing the whole procedure for you (without the table structure even) is going to be difficult.
Read More: The other 3 answers