tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parsons Technical Services" <>
Subject Re: still not clear with connection pooling in tomcat
Date Sun, 03 Apr 2005 19:33:23 GMT
In the beginning a programmer created .......

Seriously it goes like this:

To use pooling in Tomcat you can forget a lot of what is in the java api as 
Tomcat uses this to provide pooling for you.

Steps to take:

1.Determine the database you are going to use.
2.Get the JDBC drivers for that database and put them in common/lib
3.Determine if the database pool is going to serve one application or many.
4.If many, set up a Global Resource in server.xml
5.If many, add a resource link to the context for each app
4a. If one, set up a resource in the context.
5a.If one, do nothing.
6.Create a class that makes a call to retrieve the resource from the 
7.From that resource a datasource is received.
8.Ask for a connection from the datasource.
9.Tomcat will give you a connection from the pool it creates when it sets up 
the resource.
10.Use this connection as you would one from a datamanager.
11.Close the connection when you are done and Tomcat will put it back in the 
12.DO NOT call DataManager as you will bypass the connection pool.

Now after reading this, to help us give you more help please fill in the 
details above on 1,2 and 3.
Give us the exact version of Tomcat.
And OS version.


----- Original Message ----- 
From: "Krishnakant Mane" <>
To: "Tomcat Users List" <>
Sent: Sunday, April 03, 2005 8:47 AM
Subject: RE: still not clear with connection pooling in tomcat

> hello all,
> Thanks for your help on this issue.
> however I still can't get my problem solved.  10
> different articles give 10 different solutions.
> however my problem is simple.  I have a streight
> forward question.
> I want to implement connection pooling in the tomcat 5
> web container and I have the jakarta commons packages
> as well as the mysql jdbc jar file in the proper
> place.
> I found one good example in the tomcat 5 docs, but it
> talks about an example in jsp.  I exclusively use
> servlets and I want to know how I use connection
> pooling in the servlet.
> where do I use the Initial context and where do I
> initialise it?  where will the datasource come into
> question?  and how I use the connection object with
> the datasource?  all this I want to know in context of
> a servlet not jsp.
> Please help me
> and please no more references to other documents I
> have read enough of those articles and I am getting
> more and more confused.
> thanks
> Krishnakant.
> Send instant messages to your online friends
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message