commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Purcell" <>
Subject DBCP package BasicDataSource question
Date Thu, 14 Apr 2005 13:46:50 GMT

I finally figured out last night how to obtain a DataSource object in a class, and set enough
properties to get a connection:

BasicDataSource ds = new BasicDataSource();

then I get a Connection like so:
Connection conn = ds.getConnection()

I am good with all of this, and it works. Now where I am baffled is, where is the pool of
connections. Did this create a pool? I know I had to set the commons-pool.jar in my path to
get it to run. So does this class create a pool in the background? And if so, do I need to
run a thread to shut them down?  I am looking at the BasicDataSource javadocs and I see some
methods like such:

setInitializeSize(int size)
setDefaultAutoCommit(boolean val)

But I am not sure which ones are for cleaning up "lost" or "dead" connections, etc. And would
this simple configuration work for a simple web application?

Any input would be appreciated.


Scott K Purcell

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

View raw message