• 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
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Using Connection Pool To Access MySQL Database On Tomcat

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To answer question #1:
You can find Jakarta Commons at:
http://jakarta.apache.org/commons/
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The newer version of Tomcat ship with an admin app.
http://localhost:8080/admin/index.jsp
There you can configure datasources.
Axel
 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic