wood burning stoves 2.0
The moose likes JDBC and Relational Databases and the fly likes Closing connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Closing connection" Watch "Closing connection" New topic

Closing connection

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
What happens if you do not close the connection to the database?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Depends on the database provider, but most of the time, the connection times out and get's closed automatically. Of course, if you are using connection pooling, there should always be open connections anyway.
Depending on the provider and your app, it isn't a huge deal if a connection doesn't get closed. But I have seen it cause some locking problems.

GenRocket - Experts at Building Test Data
I agree. Here's the link: http://aspose.com/file-tools
subject: Closing connection
It's not a secret anymore!