[dbcp] - How to programmatically check the pool status?

2014-04-16 Thread Raffaele Gambelli

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...


Thanks in advance and best regards

Raffaele Gambelli

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



[dbcp] - How to programmatically check the pool status?

2014-04-16 Thread Raffaele Gambelli

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...


Thanks in advance and best regards

--

Raffaele Gambelli

_*Gecod s.r.l.*_ http://gecod.com/it/contatti/index.do

/Development Area/

phone: +39 051 4075795

fax: +39 051.9525291

e-mail: _rgambelli@gecod.com_ mailto:rgambe...@gecod.com

web: _www.gecod.com_ http://www.gecod.com/

skype-id: _rgambelli.gecod_ skype:rgambelli.gecod?add


/Gecod s.r.l. - Tutti i diritti riservati./

/Il presente messaggio e i documenti allegati possono contenere 
informazioni di carattere confidenziale o riservato. Qualora non foste i 
destinatari, vogliate immediatamente informarci via e-mail ed eliminare 
il messaggio, con gli eventuali allegati senza trattenerne copia./



/Gecod s.r.l. - All rights reserved./

/This message and the enclosed documents may contain information which 
is confidential or privileged. If you are not the intended recipient, 
please advise the sender immediately by reply e-mail and delete this 
message and any attachments without retaining a copy./






Re: [dbcp] - How to programmatically check the pool status?

2014-04-16 Thread Phil Steitz
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-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org




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