| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ORA-01000 max cursors error received using Oracle and JDBC
You need to close any statements you opened.
For eg:
Connection conn = DriverManager.getConnection(...);
String sql = "SELECT name FROM emp";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
while(rs.next()){
System.out.println(rs.getString(1));
}
stmt.close(); // This method will close the cursor
Make sure you are doing appropriate exception handling
and closing the statement even if there is an exception.
This should solve your problem..
In article <7lbb44$qvb$1_at_nnrp1.deja.com>,
ckuczbor_at_my-deja.com wrote:
> We are receiving the ORA-01000 (maximum open
> cursors exceeded) error when running a load test
> on our web application. We are using JAVA
> servlets, Oracle 7.3.4.2, JDBC thin driver, IBM
> WebSphere Application Server (using their DB
> connection pool manager), and Netscpape
> Enterprise Web Server.
>
> It appears that the cursors are not being closed
> or released when the servlet is finished getting
> the data. We have the Oracle max cursor
> configuration parameter set to 400. However, we
> do not want to increase this any higher. Our
> problem is that the cursors are not being
> released when the SQL call is complete, and
> therefore the number of open cursors keeps
> growing. We want the cursors to be closed or
> released when the servlet has completed all
> processing.
>
> Has anyone else had this issue and what was the
> final solution?
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Sun Jul 11 1999 - 12:56:17 CDT
![]() |
![]() |