This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes getting the active connections from connection pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "getting the active connections from connection pool" Watch "getting the active connections from connection pool" New topic
Author

getting the active connections from connection pool

sumitha sudhakar
Greenhorn

Joined: Aug 09, 2010
Posts: 21
Dear friends,
Is there a way to get the active connections from the connection Pool.
can i close the connection when using connection ppol. will the connection be automatically returned to connection pool.
Goutham Pallipati
Greenhorn

Joined: Aug 13, 2008
Posts: 20
Hi,

>> Is there a way to get the active connections from the connection Pool.
Did not get your question.
DataSource.getConnection always returns an active connection if you are using Connection Pooling.

You have to close the connection when using connection pool so that it is returned to the pool and can serve other components.
You can do it in finally block of the code.
sumitha sudhakar
Greenhorn

Joined: Aug 09, 2010
Posts: 21
Hi,

I meant to ask for the no of active connections from the connection pool?
Goutham Pallipati
Greenhorn

Joined: Aug 13, 2008
Posts: 20
As per my knowledge there is no way to get the active connection count. It Internal to the container to judge on how many connections to keep. Still you can find the Maximum no. of connections allowed in the container setting. If there is a limit at database side on number of connections allowed you can tweak the connection pool settings to match it.

by the way why do you need that.
 
Don't get me started about those stupid light bulbs.
 
subject: getting the active connections from connection pool
 
Similar Threads
garbage collection and statement closing question
Does ojdbc14.jar compatible with oracle9i
connection releasing problem in weblogic.
ojdbc14.jar connection pool cache issue
Query regarditng Connection Pooling