aspose file tools
The moose likes JSP and the fly likes Can I Pool Connections to DB Across JSPs? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Can I Pool Connections to DB Across JSPs?" Watch "Can I Pool Connections to DB Across JSPs?" New topic
Author

Can I Pool Connections to DB Across JSPs?

Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
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
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
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
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
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!

You are correct on both counts.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I Pool Connections to DB Across JSPs?
 
Similar Threads
WebSphere 4 connection pooling.
Connection Pool with JSPs
What are db configuration parameters like initialsize,max active?
JNDI LDAP Connection pooling
Database connection management