commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: [dbcp] - How to programmatically check the pool status?
Date Wed, 16 Apr 2014 17:24:26 GMT
On 4/16/14, 2:33 AM, Raffaele Gambelli wrote:
> Hi all,
>
> I'm using Tomcat 6.0.26 and its default dbcp connection pooling
> system (tomcat-dbcp.jar inside the default installation dir)
>
> My question is:
> How could I check programmatically the connection pool status ?
> For example inside a catch of some exception related to some
> database issues I would like to log some info like the number of
> currenlty open connections, idle etc...

Have a look at the javadoc for BasicDatasource for the version that
tomcat 6 is using (some 1.x version).  There are getters for the
number of active and idle connections.  You may need to cast the
reference that tomcat gives you to the datasource to use these
methods.  You may want to ask about this on the tomcat user list.

Phil
>
> Thanks in advance and best regards
>
> Raffaele Gambelli
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>


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


Mime
View raw message