tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Connection Pooling
Date Tue, 25 Feb 2003 15:26:11 GMT
This is a Tomcat JNDI implementation. I tried different solutions Tomcat,
Oracle connection caching and commons. Among them, Tomcat's is very simple.
commons-dbcp + pooling require more coding but have more flexibility of

"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-----Original Message-----
From: Malcolm Green [] 
Sent: February 25, 2003 5:36 AM
To: 'Tomcat Users List'
Subject: RE: Connection Pooling

I have DBCP connection pooling working as follows using Tomcat 4.1.12:

Under the <Context> element for your application (this can either be in the
server.xml file or a separate xml file in the webapps dir)  I have the
following config:

 	      <Resource name="jdbc/XXXX" scope="Shareable"

	      <ResourceParams name="jdbc/XXXX">




		      <value>select getdate()</value>


This is an MS SQL Server config, but to change the db just make sure that
the requried JDBC jar file is in the common/lib directory and then change
the necessary elements above e.g. driverClassName etc.

In my web.xml for my app I have the following:


To use the pool I have the following code in a servlet:  (I have left out
the try/catch block etc.)

  Context ctx = new InitialContext();
  DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/XXXX");
  conn = ds.getConnection();

Hope this helps.


-----Original Message-----
From: Sebastiªo Carlos Santos []
Sent: 21 February 2003 00:15
Subject: Connection Pooling

Somebody has some experience or example in the 
configuration and use of pool of connections with the 
I am a little lost and I don't know through where to 
All information will be well arrival.  
I thank the help in advance

E-mail Premium BOL
Antivírus, anti-spam e até 100 MB de espaço. Assine já!

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

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message