1 Reply Latest reply on Sep 4, 2019 10:44 AM by Zlatko Sirotic

    JDBC call PL/SQL stored procedure with 'cursor' as an in paramater

    grimrand

      Hi,

       

      Java newbie question !

       

       

      I am developing an application that calls an Oracle stored procedure using JDBC OracleCallableStatement and registering an out parameter as an OracleTypes.CURSOR - processing as a result set.

       

      Something like :

       

        cs.registerOutParameter(1, OracleTypes.CURSOR);

        cs.execute();

        ResultSet resultSet = (ResultSet) cs.getObject(1);
         while (resultSet.next()) {....

       

      My issue is calling a PL/SQL stored procedure to insert new records. The id column in the table is based on an oracle sequence and so not an attribute that is passed to the stored procedure

       

      ie I might pass fname, sname and address but not the empID.

       

      I cant seem to get setCursor to work, and this seems to be depreciated anyway.

       

      What would be the bet way to call the stored procedure and pass only required attributes ? Object Array perhaps ?

       

       

       

      Regards

       

      Terry