Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 11th, 2007, 12:17 AM
Registered User
Join Date: May 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection Pooling using Tomcat 5.0 x and MY SQL s

Hi, can any body give the steps for configureing Connection Pooling using Tomcat 5.0 x and with MySQL server as backend in windows platform. I have checked the apache tomcat documentation but iam unable to understand as iam new to this. If any body knows the detailed steps, plese forward.

Can ony one give some sample code/example...

My Personal Mail-id is dhruthi.sharma99@yahoo.co.in

Old September 11th, 2007, 04:22 AM
Registered User
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to neo.isbackin.thematrix

Hi Dhruthi,

Even I havent done this thing before but I searched on net and what i found is this.

Jakarta-Commons Connection Pool is used in this. We need to modify the 'server.xml' file in 'conf' directory of 'CATALINA_HOME'(The Tomcat Installation you are using). You need to make an entry related to JNDI in that. It will be like this.

<Context path="/dbcp" docBase="dbcp" debug="5" reloadable="true" crossContext="true">
   <Resource name="jdbc/TestDB" auth="Container"

All the configuration of you Connection Pooling can be done here.

A <resource-ref> entry in your project's 'web.xml' file makes the thing known to your project. The entry is like this.

      <description> DB Connection Pooling</description>
      <res-ref-name> jdbc/TestDB</res-ref-name>
      <res-type> javax.sql.DataSource</res-type>
      <res-auth> Container</res-auth>

What i have found is this. The reference is : http://www.onjava.com/pub/a/onjava/2...th-tomcat.html

Old September 11th, 2007, 07:32 AM
Registered User
Join Date: May 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

 Thanks for your feedback. i written same code ie i updated server.xml file and web.xml. But stil iam not able to achive connection pooling.
Whether i have to write any steps for datasources, ie JNDI Name: , Data Source URL:, etc which is located inside the tomcat administration tool.
if so what steps i have to write.
Please help in this.


Old September 13th, 2007, 11:51 PM
Friend of Wrox
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post

Try to go through the article at the following link, might be helpful to you to solve your problem


- Rakesh

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection Pooling problem. nitinp ASP.NET 2.0 Professional 2 July 9th, 2007 02:12 AM
Connection Pooling nigam.anand Apache Tomcat 0 October 18th, 2006 08:39 AM
Connection pooling and Timeout Raghavendra_Mudugal SQL Server 2000 2 May 24th, 2006 01:42 AM
Connection pooling in VB vijayma VB How-To 0 March 18th, 2005 03:51 AM
Connection Pooling with Beans angrycat Apache Tomcat 4 September 16th, 2004 06:11 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.