> Vitaly Yermolenko wrote:
>
> Hi!
>
> Has anyone known what I must to do in case:
>
> java.sql.SQLException: ORA-01000: maximum open cursors exceeded
>
> In my servlets for access to Oracle database I use the next constructions, like:
>
> try
> {
> stmtStmt = connConn.createStatement ();
> rsResult = stmtStmt.executeQuery (strQuery);
> while (rsResult.next ())
> {
> . . .
> }
> }
> catch (SQLException e1)
> {
> try
> {
> if (rsResult != null)
> rsResult.close ();
> if (stmtStmt != null)
> stmtStmt.close ();
> }
> catch (SQLException e2) { }
> }
> finally
> {
> rsResult = null;
> stmtStmt = null;
> }
> but after some time I have this SQL Exception...
>
> I use Kaffe VM 1.0b4 + Apache/1.3.4 + JServ 1.0b1 + Oracle JDBC Thin Driver
>7.3.4 (classes111.zip) on the RH
> Linux 5.0 for connection to the Oracle7 Server
> (7.3.2.1.0).
> If you can give me some help regarding this problem it will be nice...
In the code sample you only close the ResultSet and Statement if you get an
SQLException. You need to move this code to the finally clause so you always
close the database resources.
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html