It's not a secret anymore!
The moose likes JDBC and Relational Databases 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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Can we preserve Connection object" Watch "Can we preserve Connection object" New topic

Can we preserve Connection object


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

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

Joined: Jan 10, 2002
Posts: 63534

"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.

Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Can we preserve Connection object
It's not a secret anymore!