Good call Ana; and the following "template" is how you should implement all
your jdbc calls:


Connection conn                 = null;
PreparedStatement stmt  = null;
ResultSet results               = null;
try
{
        conn = dataSource.getConnection();
        stmt = conn.getPreparedStatement();
        results = stmt.execute();
}
catch(SQLException se)
{
}
finally
{
        if(results !=null) results.close();
        if(stmt !=null) stmt.close();
        if(conn !=null) conn.close();
}

Gene Chuang
Teach the world...  Join Kiko!
<http://www.kiko.com/profile/join.jsp?refcode=TAF-gchuang>

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Bhattacharyya, Ana
Sent: Wednesday, September 13, 2000 9:20 AM
To: [EMAIL PROTECTED]
Subject: Re: Cursors Open problem with multiple insertions


well this can happen if u are not closing ur ResultSet or statement objects.
Do close them in the finally block of ur code.
HTH
Ana

-----Original Message-----
From: Purushotham Das K [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 13, 2000 12:08 PM
To: [EMAIL PROTECTED]
Subject: Cursors Open problem with multiple insertions


Hi Folks

        I am getting the folllowing error ----> " Maximum Number of Cursors
Opened"
        I have written a session bean that is accessing an entity bean. Iam
working on weblogic 5.1 on solaris server.
        When I insert 13 or more rows into a table in a single call to
session bean, I get the above error. Everything's fine when I try to insert
less number of records
         Can somebody enlighten me on this error?

  Thanks in advance
   Purush

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".


STATEMENT OF CONFIDENTIALITY.   The information contained in this electronic
message and any attachments to this message are intended for the exclusive
use of the addressee(s) and may contain confidential or privileged
information. If you are not the intended recipient, please notify
USPowerSolutions Corporation immediately at (617) 547-3800, or at
[EMAIL PROTECTED], and destroy all copies of this message and any
attachments.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to