File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Checking Connection Pool Size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Checking Connection Pool Size" Watch "Checking Connection Pool Size" New topic

Checking Connection Pool Size

Aaron Hanson

Joined: Aug 26, 2003
Posts: 15
Is there a way I can check the status of the connection pool using JNDI?

I'm working on a web application using Tomcat and SQL Server with the JTDS driver and I'm having concerns that I may have some stray connections open or some performance issues that I want to tweak. I'd like to make a JSP/Servlet that I can get the health information (active connections, open connections etc) about the connection pool at any given time.

Any help on how to do such a thing?
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
Some pools or J2EE containers have the functionality built-in. Sometimes it is a config setting on the pool. Sometimes it is a JMX component exposing the runtime state of some kind of pool manager. I'd start by checking the documentation, admin gui, and any javadoc for stuff that sounds JMX-ish.

Reid - SCJP2 (April 2002)
Aaron Hanson

Joined: Aug 26, 2003
Posts: 15
I looked into the JMX stuff and I've got Tomcat's manager app to at least display what I'm looking for.
I've been messing around with the query strings and came up with this one for now.

I agree. Here's the link:
subject: Checking Connection Pool Size
It's not a secret anymore!