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"
type="javax.sql.DataSource"
removeAbandoned="true"
removeAbandonedTimeout="30"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="kunal"
password="java_facier"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/dbcptest"/>
</Context>
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.
<resource-ref>
<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>
</resource-ref>
What i have found is this. The reference is :
http://www.onjava.com/pub/a/onjava/2...th-tomcat.html