I am using struts framework. I am getting a “cursor is closed” error.
I have checked my storedprocedure and it’s working well in oracle but still I am getting the “cursor is closed” error.
Caused by:
java.sql.SQLException: Cursor is closed.
at oracle.jdbc.driver.T4CResultSetAccessor.getCursor(T4CResultSetAccessor.java:323)
at oracle.jdbc.driver.ResultSetAccessor.getObject(ResultSetAccessor.java:85)
at oracle.jdbc.driver.OracleCallableStatement.getObject(OracleCallableStatement.java:1401)
Can you help me understand what caused this?
Since you have not provided the code, but according to my assumption, you are returning a cursor from the procedure by opening it, but at the same time you might be closing the cursor in the same procedure.
The client calling the stored procedure is responsible for closing the cursor. Please remove the code:
CLOSE test_OUT;Refer: Cursor is Closed