tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <>
Subject Re: MySQL-connection pool
Date Mon, 14 Jun 2004 12:29:08 GMT
Take a look at:

About halfway down the page is a section titled 'JDBC Data Sources'

Also take a look at:

This page has some specific examples to look at.  I should point out the 
mysql jar has to be in common/lib to work with DBCP.


Trond Hersløv wrote:

>Hi !
>I have installed MySQL and is able to access it in a servlet like this:
>Connection conn =
>This creates a new connection to the DB every time, and I therefore want to
>use a connection pool.
>I tried to set up a connection pool in the tomcat-admin interface, but it
>seems like I can't get it right. I'm also not quit sure how to
>get a connection from the pool even if it is set up right.
>I assume something like this would be correct: 
>Connection conn = DriverManager.getConnection("mysql"), where mysql is the
>jndi name of my pool.
>The Tomcat documentation referrs to a non existing link (
><> ).
>Do I have to install any extra classes to make the connection pool work
>correctly? Here is my current system config
>Linux 2.4.20
>Apache webserver: 2.0.49
>jk2: 2.0.4
>Tomcat: 5.0.24
>MySql: 4.0.20
>MySQL-connector: 3.0.12
>J2SDK 1.4.2_04
>Who can give me an example of how to set up and get a connection from a pool
>with connections to a MySQL database?
>Thanks, Trond
>This email message has been swept by
>MIMEsweeper for the presence of computer viruses.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message