commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
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 
question:

> *	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());

Regards
Dirk


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message