I want to pool connections to the database, to save time/resources. However, I was not sure of the context/life-cycle of a JSP, especially relative to other JSPs. Would this even work? Is it really possible to pool them across JSPs/Servlets? How would I go about doing this? Thanks!
Matthew Phillips
Ranch Hand
Joined: Mar 09, 2001
Posts: 2676
posted
0
If you store the connection pool in the application context then it will be available to all Servlets/JSPs in the application.
Matthew Phillips
Robert Paris
Ranch Hand
Joined: Jul 28, 2002
Posts: 585
posted
0
Thanks for the reply! By application context, I assume you mean Servlet Context? Also, to be sure I understand: I save the Connection Pool Handling Object, not the connections themselves there, right? Thanks!
boyet silverio
Ranch Hand
Joined: Aug 28, 2002
Posts: 173
posted
0
the structure of the pool class usually contains a property, e.g. a collection object, for the connections to be managed. so if a connection pool handling object of this type is saved in the servlet/application context, in a way, the connection objects it contains are also stored into that context. these connection objects will still have to be accessed though via the pool object in that context.
Matthew Phillips
Ranch Hand
Joined: Mar 09, 2001
Posts: 2676
posted
0
Originally posted by Robert Paris: Thanks for the reply! By application context, I assume you mean Servlet Context? Also, to be sure I understand: I save the Connection Pool Handling Object, not the connections themselves there, right? Thanks!