Recently done projects encountered ORA-01000 errors, reference to some solutions, to solve their own problems to write down some of the experience.
Java accesses an Oracle database, and in the For loop code, if you omit the connection that was established by closing createstatment or PreparedStatement, an error occurs: ORA-01000.
Background knowledge:
Each use of Oracle with Createstatment or PreparedStatement statements opens a cursor, so simply increasing the number of open cursors in Oracle is not the solution.
Problem solving:
1: The first position is that those statements open cursors are too large.
Execute the following statement:
SELECT *
From V$open_cursor
where user_name = ' tech '
2: From the Sql_text field of the search results above, locate the SQL statement, and then go to the Java code to locate the code that executes the statements.
Add the Close method for the PreparedStatement or statement class.