Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

verify database connection pool

Daxin Zuo

2004-05-07

Replies:

I created a DB Connection Pool with net.sourceforge.jtds.jdbc.Driver,
org.apache.commons.dbcp.BasicDataSourceFactory

In java code, I use the connection as:
  ......
  Connection con = null;
  try {
   Context ctx = new InitialContext();
   DataSource ds = (DataSource) ctx.lookup(
       "java:comp/env/jdbc/DirectSQL");
   con = ds.getConnection();
    ....
   con.close();

"jdbc/DirectSQL" is found, and The databse get connected. I thought after I
close the connection, Tomcat handles the "con" in the pool.

Somebody says that I have not used a DB connection pool. It is only a
connection I get. Connection from pool should use poolXXXX or XXXXpool.

So I start to doubter. Please confirm or teach me how to use Connection
pool.

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.