You have to close the statement after you use it.
stmt = con.createStatement();
rs = stmt.executeQuery(qs);
perform query here
rs.close();
stmt.close();
Each time you run the createStatement() method it opens a cursor in Oracle.
When you close() it closes the cursor.
-Eric
At 04:10 PM 4/9/99 -0500, Formanek Gary L wrote:
>I have been trying to get connection pooling to work for our servlet. I'm
>using the DbConnectionBroker from http://www.javaexchange.com/. However, I
>keep getting the following error:
>
>Error code = -5 Error message = A SQL Exception has occurred in
>insertUpdateDelete. SQLState: Message: ORA-01000: maximum open cursors
>exceeded Vendor: 1000
>
>It seems to work for 3 or for transactions and then gets this message. Wait
>a bit and then it works 3 times. I've tried raising the OPEN_CURSORS
>initialization for Oracle 7.3, but it only goes longer and then has the same
>problem.
>
>I've double-checked the code and I'm doing a getConnection() and then a
>freeConnection() in the same method and the freeConnection() is in a finally
>block, so it always gets executed.
>
>Has anyone run across a similar problem?
>
>I appreciate any help.
___________________________________________________________________________
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