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: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
