wood burning stoves 2.0
The moose likes JDBC and Relational Databases and the fly likes Using Connection Pool To Access MySQL Database On Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Using Connection Pool To Access MySQL Database On Tomcat" Watch "Using Connection Pool To Access MySQL Database On Tomcat" New topic

Using Connection Pool To Access MySQL Database On Tomcat

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Hi, I was reading the instructions to use connection pool to access MySql database on Tomcat 4.1.18. The instructions are at the web link below:
I am confused and need help:
1. In the instruction, it says that DBCP uses the Jakarta-Commons Database Connection Pool. It relies on number of Jakarta-Commons componenets:
Jakarta-Commons DBCP 1.0
Jakarta-Commons Collections 2.0
Jakarta-Commons Pool 1.0
These jar files along with your the jar file for your JDBC driver should be installed in $CATALINA_HOME/common/lib.
Question: Where do I find those jar files. The links are not provided in the instruction.
2. To configure a DBCP DataSource so that abandoned dB connections are removed and recycled, add the following paramater to the ResourceParams configuration for your DBCP DataSource Resource.....
Question: I know how to add ResourceParams. But ... where do I configure DBCP DataSource Resrouce? In the server.xml? Which section in the server.xml?
Thank you for your help.
Mike Farnham
Ranch Hand

Joined: Sep 25, 2001
Posts: 76
To answer question #1:
You can find Jakarta Commons at:
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
Since you are using a late model Tomcat server, then DBCP is already present and functional. You don't need to install anything.
I advise that you also use the latest production JDBC driver for MySQL (com.mysql.jdbc.Driver).

Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
The newer version of Tomcat ship with an admin app.
There you can configure datasources.
I agree. Here's the link: http://aspose.com/file-tools
subject: Using Connection Pool To Access MySQL Database On Tomcat
It's not a secret anymore!