Hi, You have to cast the DataSource to its implementation type, since javax.sql.DataSource doesn't provide for pool statistics. The implementation class, e.g. org.apache.dbcp.BasicDataSource, provides various statistics methods including the number of active connections.
Yoav Shapira http://www.yoavshapira.com >-----Original Message----- >From: Trond G. Ziarkowski [mailto:[EMAIL PROTECTED] >Sent: Friday, October 29, 2004 6:52 AM >To: [EMAIL PROTECTED] >Subject: Active connections in db pool > >Is there a way of finding out how many commections which are currently >active when using a db connection pool? I got this error message in my >logs: "Cannot get a connection, pool exhausted". When I increased the >number of mxActive the error message of course disappeared. I tripled >the number of connections just to make sure that it will not happen >again for some while, but I would like to check the value from time to >time so I can increase it yet again if that would be necessary or >decrease it if I really needed just oldMax + 10. > >Regards >Trond Ziarkowski > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]