Title: RE: EXCEPTION
Caution here. A mistake I see all the time is that a developer will create a loop in which a PreparedStatement object, or some other result set generating entity, is instantiated every time through the loop. If you don't hava a matching close() on these objects, you will get too many open cursors very quickly.
 
The proper way to handle the situation is to create a single PreparedStatement object, then change the bind variable values every time through the loop. This way you only create a single cursor with changing the variable values every time through the loop. This also has a performance advantage since the database engine will not have to reparse the sql statement every time through.
 
Dave

[Godbey, David]  -----Original Message-----
From: Julian Eduardo de Anquin [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 24, 2001 8:31 AM
To: [EMAIL PROTECTED]
Subject: Re: EXCEPTION

it is not enough to close the connections? i must also close the statements and the resultsets?
thanks a lot
Julian
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Naresh Chhuttani
Sent: Viernes, 24 de Agosto de 2001 03:39 a.m.
To: [EMAIL PROTECTED]
Subject: Re: EXCEPTION

Close all the connections in ur program
You can also increase the max number of connections
in DB Server.



Reply via email to