Daxin,

That somebody is referring to the connection pool api available in the j2se.
What they are not picking up on is that you are requesting the connection
from the datasource. And under tomcat this is a connection pool. And what
you are receiving in fact is a connection but one from the pool that was
established by Tomcat. Your code is correct and is using the connection pool
features of Tomcat. If you are in need of more proof then download the
source and look through it. I have.

Doug
www.parsonstechnical.com


----- Original Message ----- 
From: "Daxin Zuo" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Friday, May 07, 2004 2:29 PM
Subject: verify database connection pool


> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to