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

1

I have the following error:

  

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 you increase the number of cursors or close the connections, closing the connections would be the best option. My application is in java and used the default of POJO and DAO to connect to the oracle database.

My two top questions are:

If I have to close the PreparedStatement of the include, change, delete, or just query methods (and in the query also close ResultSet )?

Can I close it like this?:

PreparedStatement ps = ConexaoOracle.getConexao().prepareStatement(SQL_CONSULTAR);
    ps.close();
    
asked by anonymous 17.06.2017 / 00:56

0 answers