Causes the maximum number of open cursors to occur when using JDBC to manipulate data: typically occurs when a large number of INSERT statements are executed, statement is not closed.
Workaround: Each time you insert a piece of data or find a batch commit, remember
stmt = Conn.createstatement ();
Stmt.close ();
</pre><p></p> considerations when using Connection and statement <pre name= "code" class= "java" >connection conn = Drivermanager.getconnection ("Proxool.") Dbczr ");
Statement stmt = Conn.createstatement ();
Connection: Gets a database connection at once. This object can be reused, just as you log in Plsql can always use a reason. However, it is best to insert the 1W data when the close to a better connection, otherwise it is possible to shut down the database and so on.
Statement: Used to execute simple SQL statements with no parameters and cannot be reused. Repeated use can error ORA-01000: exceeds the maximum number of open cursors.
Note: When we use the same statement object to perform bulk operations and execute a single SQL, the error also occurs. So this object, every time you manipulate SQL, be sure to instantiate the object.
Execute a single SQL
Statement. ExecuteBatch ()//Execute Batch
Execute Batch SQL
statement. Addbatch (SQL);
Statement. Execute (SQL)