I've never done this before, but, theoretically, each prepared statement
should be associated with one connection, right? for some implementation of
connection pool, they have a timeout factor to disconnect the connection
after some time interval. if so, you will lose your prepared statements
because the connection is gone... so I don't see it's possible to put them
into init(). even if the connections are never gone, you have to prepare the
same sql statement with each of the connection in the connection pool, this
can bring exponentially more lines of coding when you set up your "prepared
statement pool"...

----Original Message Follows----
From: John Larson <[EMAIL PROTECTED]>

Hi,

I would like to put several prepared statements where I think they
belong, in the init section of my servlet.  This would allow the
statement to be prepared only once instead of every time a request comes
in.

Has anyone done this successfully?  If so, how?  If it can be done, do
you then need a "prepared statement pool", similar to a connection pool
to protect the threads?

Thanks,
John

___________________________________________________________________________
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




_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.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

Reply via email to