commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <>
Subject Re: [dbcp] pooling configured/works fine. Few DBCP questions for experts.......
Date Sat, 18 Jun 2005 11:07:44 GMT
That previous mail was send too fast, here is the answer to your last 

> *	Can we find out if we can programmatically know how many
> Connections are there in the pool, how many are active, how many are
> idle, etc? This is just to print these statistics (may be once an hour)
> in the log file to ensure nothing is fishy with DB level.

Yes, if you cast the DataSource to the specific implementation then you 
can print out usage statistics:
         BasicDataSource bds = (BasicDataSource) ds;
         System.out.println("NumActive: " + bds.getNumActive());
         System.out.println("NumIdle: " + bds.getNumIdle());


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

View raw message