In fact, the cause of this error is mainly caused by a code problem.
Ora-01000:maximum open cursors exceeded.
Indicates that a process has reached the maximum number of cursors opened.
The main reason for such errors to occur easily in Java code is that Java code is actually quite similar to opening a cursor in the database when executing conn.createstatement () and Conn.preparestatement (). In particular, if your createstatement and preparestatement are inside a loop, you will be very prone to this problem. Because the cursor is constantly open and not closed.
In general, when we write Java code, both createstatement and preparestatement should be placed outside the loop, and when these statment are used, they are closed in a timely manner. It is best to close the statment immediately after performing a executequery, executeupdate, and so on, if you do not need to use the result set (ResultSet) data.
Written on December 21, 2016, when there is a dead loop in the thread, the cursor overrun is not caused by statement.close.
java.sql.sqlexception:ora-01000: Maximum number of open cursors exceeded