• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Connection Pooling - Passing your pool to the application

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
***** 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. . .
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic