org.apache.commons.pool.ObjectPool offers methods for querying for the number of active and idle objects in the pool. If you can somehow access the internal ObjectPool instance of your DBCP pool, this might be the missing link. (I have no idea whether you can access the ObjectPool but I think it's worth a look)
Ali - maybe "interactively" was a bad word to use, what I really want to do is just display a var on the JSP pages as we're using the app so that I can see at what point the database connections get Darned to Heck (or just have a jsp page I can call at any point.)
Lasse - thanks, I'll dig into the API. I will post the solution if I find it, if anyone manages to put it together before then I would appreciate the help.
Joined: Oct 29, 2004
Just saw my original post - I'm using DBCP, not dhcp. Not sure if dhcp is anything real ... but for the record I'm using DBCP...
Joined: Jul 12, 2004
Going on the Lasse's idea I have found out this:
For example the Tomcat servlet container presents a DBCP DataSource as a JNDI Datasource.
Ok, looks like the methods are available in the BasicDataSource class I need (at least they look like the right ones.) I can write an Action that pulls this info together and displays it on a JSP. Will gladly provide that when I get a chance.
QUESTION Ideally I would be able to stick all of the logic right into a JSP (no Action, thus no entry needed in struts-sonfig, thus I can just drop the JSP into any application.) Doesn anybody know how I can get a reference to the servlet (or the struts datasource) from inside of the JSP without using an Struts Action/Struts Form bean?