I've a case where I call a java source from PL/SQL package and in java source, I insert data to my database table. By this insert operation, a cursor is left open every time I make a call.
I can't make changes to this java source and hence can't close the resultset there.
So I want to write some PL/SQL code in my package to close the cursor after every call to java source and insertion of data.
How can I do so? I don't want to increase my maximum open cursor limit.
If you are using preparestatement to execute the sql, then you can create a different object to hold off the data and then can close the statement to close the cursor.
don't close the statement before transferring the data to a different object otherwise you will get a Closed statement error.