Using Connection Pool To Access MySQL Database On Tomcat
JiaPei Jen
Ranch Hand
Joined: Nov 19, 2000
Posts: 1309
posted
0
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: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html 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.
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!