How to view/monitor live database connections in a database pool?
We use database connection pooling fo开发者_StackOverflow中文版r our java application. It is a web app run under tomcat.
I want to view live connections in the pool as they are created and destroyed. Can somebody please help?
UPDATE: We are using Oracle 11g. We use DDConnectionBroker library for connection pooling.
I am not sure if there are any connection monitoring API's in DDConnectionBroker library... I would recommend Proxool if you want more transparency.
http://proxool.sourceforge.net/
Also check out DBCP and CP30, DBCP is the best in the bucket
http://www.java2s.com/Product/Java/Database/Connection-Pool.htm
I was searching for this issue too and could collect what I need from:
org.apache.commons.dbcp.BasicDataSource
If you are using Spring is so easy to inject this information on your bean and retreive what you need from this object, that shall came injected and already instantiated for you.
Any questions let me know!
精彩评论