| Author |
Connection Pooling - Passing your pool to the application
|
Bobby Cunningham
Greenhorn
Joined: Dec 08, 2005
Posts: 7
|
|
***** My environment ***** JDK - 1.5 App Server - Tomcat 5.5 Database - Sysbase Framework - Struts ***** My question ***** When my application starts we kickoff a Startup Servlet that extends HttpServlet. In this servlet I initialize the DB Pool with a min of 5 connections. This creates a pool that stores the connections. So the only use of our servlet is to init the application. How do you pass the pool object to the rest of the application? What is the best way to handle this? Please help. . .
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12911
|
|
Usually, you configure the connection pool in Tomcat (in one of the XML configuration files). Tomcat will register the pool in JNDI, and you'll use JNDI in your application to lookup the pool (in the form of a DataSource object). The Tomcat documentation explains in detail how to do this: JNDI Datasource HOW-TO
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Connection Pooling - Passing your pool to the application
|
|
|