aspose file tools*
The moose likes JDBC and the fly likes Do we need to close the Connection while using Connection Pooling? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Do we need to close the Connection while using Connection Pooling?" Watch "Do we need to close the Connection while using Connection Pooling?" New topic
Author

Do we need to close the Connection while using Connection Pooling?

reddy sekhar
Greenhorn

Joined: Aug 14, 2009
Posts: 11
Hi Friends,

i am quite new to connection pooling concept. i would like to know that, once we get the Connection from the connection pooling, after using the Connection, should we need to Close the Connection by calling Connectin.close(). Or Connection Pooling itself manages the same.

Thanks for your help in Advance.

- Chandra.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
reddy sekhar
Greenhorn

Joined: Aug 14, 2009
Posts: 11

Thanks for your reply Paul Sturrock.

You mean we need to close the Connection (Connection.close()) manually?


thanks
Reddy.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30299
    
150

To elaborate - yes, calling close() is what tells the connection pool you are done using the connection and it can be given to another user.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Do we need to close the Connection while using Connection Pooling?