aspose file tools*
The moose likes JDBC and the fly likes Can we preserve Connection object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Can we preserve Connection object" Watch "Can we preserve Connection object" New topic
Author

Can we preserve Connection object

Sudheesh
Greenhorn

Joined: Sep 22, 2005
Posts: 11
Dear sirs,

Can we preserve Connection object using any of the desin pattern such as service locator?
Will the container close the connection itself after some idle time? If that is the case, how can we preserve the connection?
I heard that to obtain a connection every time, is additional overhead to the container..

Thank you,
Sudheesh K S
[ October 06, 2005: Message edited by: Bear Bibeault ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Use a ConnectionPool, they do this for you. If you search this forum you will find references to free implementations.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61222
    
  66

"Sudheesh K S",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: Can we preserve Connection object