Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connectionpool Active connection

 
Shilpa Nandiv
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please tell me the javacode that is,Iam using tomcat.jdbc.connectionpool.So using javacode how can i get how many connection running,sleeping and close and also active connection in program.

How can we confirm that how many connection active in program.I searched but not got any answer please tell me

Thanks
svn
 
Paul Clapham
Sheriff
Pie
Posts: 20769
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I expect you saw the documentation page here? http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

Well, there's a code example near the bottom of that page. It creates a org.apache.tomcat.jdbc.pool.DataSource object; check out the API documentation for that class here: http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/tomcat/jdbc/pool/DataSource.html.

If you look through that API documentation long enough (and there's a big list of methods to go through) you'll see there are methods like getNumActive(), getNumIdle(), and so on. Was that what you were looking for?
 
Shilpa Nandiv
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

I want to know about connection,when web application running it will use so many connection.But i want to no how many connection are using,and sleeping all information.So how can i get this information in program or some other method are there to check tomcat.apache.jdbc.connection pool.Please tell me

Thans
svn
 
Shilpa Nandiv
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using tomcat7 in that apache.jdbc.connectionpool.so using javacode i want to know

What I am looking for are the following items.

Show that there are defined number of active connections in the application.

Any additional request will add to the pool. If they get into sleep mode, the pool reduces back to predefined value.

Any release of connection will reduce from the pool.

An established connection stays connected until the started task is not completed.

so please tell me how can do.

thanks
svn
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic