Getting the connection pool properties

I have set up a connection pool in tomcat’s server.xml and context.xml.

I am using the below code to establish a connection.

DataSource ds = (DataSource) context.lookup(“jdbc/TestDB”);
ds.getConnection();

Now I want to get the properties like MaxActive, MaxIdle etc. But I don’t see any method that can be called using DataSource object. How can I get those parameter values ?

Answer

Attribution
Source : Link , Question Author : Vinayak , Answer Author : Community

Leave a Comment