Many friends often encounter ORA-01000: Maximum Open Cursors Exceeded. When using Oracle databases in Java development. In fact, this error is caused by the main code problem. ORA-01000: Maximum Open Cursors Exceeded. Represents the maximum number of cursors that have reached a process. Such an error is easy to appear in the Java code: Java code is actually quite equivalent to a CURSOR in the database in executing conn.createstatement () and conn.prepareStatement (). In particular, if your CreateStatement and PrepareStatement are in a loop, this problem is very easy. Because the cursor has been open to open, and there is no closed. In general, when we write Java code, CreateStatement and PrepareStatement should be placed outside the loop, and after using these statments, close it in time. It is best to execute an ExecuteQuery, ExecuteUpdate, etc., if you do not need to use the result set (Resultset), you immediately turn StaSe () method immediately, call the Close () method. For this situation, ORA-01000 errors, simple increase Open_CURSORS is not a good way, that is just the standard. In fact, the hidden dangers in the code are not released. Moreover, in most cases, Open_CURSORS only needs to set a relatively small value, which is sufficient to use unless there is a very special requirement.
Reprinted from ITPUB