java.sql.Sqlexception: ORA-01000: maximum open cursors exceeded

Asked

Viewed 1,438 times

1

I’m making the following mistake:

java.sql.Sqlexception: ORA-01000: maximum open cursors exceeded

From what I researched, the error happens when the maximum number of cursors is exceeded, and to solve, or Voce increases the number of cursors or closes the connections, and closing the connections would be the best option. My application is in java the standard of POJO and DAO to connect to the oracle database.

My two main doubts are:

If I have to close the PreparedStatement the methods to include, modify, exclude or only consult (and in the consultation also close the ResultSet) ?

I can close it like this ?:

PreparedStatement ps = ConexaoOracle.getConexao().prepareStatement(SQL_CONSULTAR);
    ps.close();
  • 1

    Yes, the ideal is to close everything, mainly the connection object that should be the one causing the exception.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.