This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes a question on connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "a question on connection pooling" Watch "a question on connection pooling" New topic

a question on connection pooling

Chuan Ren
Ranch Hand

Joined: Aug 04, 2003
Posts: 42

I am looking at using Jakarta Common DBCP to manage my database connection. However, I am a bit confused on how to use this. I understand I could setup a data source in Tomcat to achieve the parameter setting.

However, I am looking at doing something which is independent of the application server. How can I setup those parameters for DBCP? Any advice or example is much appreciated.

Thank you.
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
I'm not sure I fully understand your question.

Do you want to setup the datasource inside your application? Instead of having it setup inside the server.xml? If you use struts you can set up the DataSources inside your struts-config.xml, or you could use something like ibatis or hibernate to manage your database access. Or lastly you can configure access inside of your own servlets (or even jsps if you want to get really messy).

Are you trying to avoid something like:

in your server.xml?

It is sorta covered in the JavaRanch Style Guide.
subject: a question on connection pooling
Similar Threads
Apache Commons DBCP connection object problem
How to get underlying connection
Best Database Connection Pools ?
integrating Struts with DBCP
Need information on Third Party Connection Pooling Managers compatible with Tomcat 5.5