commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Zoetebier <>
Subject Re: When does dbcp close a connection?
Date Wed, 26 Nov 2003 20:30:12 GMT
On Wed, 26 Nov 2003 17:34:05 +0100, Zsolt Koppany 
<> wrote:

> Hi,
> I have looked into the dbcp sources and getConnection just returns a
> java.sql.Connection object. Does that mean that connection.close closes 
> the
> connection to the database? If not, when will be the connection really
> closed?

Connection.close will return the connection to the pool.
After setting up DBCP yout code can basically stay the same.
To close the real connection to the database at application shutdown do:

This will closed the actual connections to the databse.
I made a wrapper class for setting up DBCP and closing the connection pool.

John Zoetebier
Web site:

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

View raw message