Hi,
Either use the same connection, i.e. don't return it to the pool between
executions, or re-prepare the statement with every connection.  The
choice depends on how often you run these queries.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Koon Yue Lam [mailto:[EMAIL PROTECTED]
>Sent: Monday, July 19, 2004 11:42 AM
>To: Tomcat Users List
>Subject: Help on tomcat 5.0 connection pool
>
>Hi, I am using Tomcat 5.0 and Stuct 1.1 to develop a web base
application
>and I want to create some prepareStatement and execute it multiple
times
>but since the connection is retrieved from the pool upon request, I
>may get a number of connections, how can I create a prepareStatement
>to a specific connection??
>
>code like this:
>
>PreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES
>                                     SET SALARY = ? WHERE ID = ?");
>   pstmt.setBigDecimal(1, 153833.00)
>   pstmt.setInt(2, 110592)
>
>
>Regards
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to