wood burning stoves*
The moose likes JDBC and the fly likes Closing connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Closing connection" Watch "Closing connection" New topic
Author

Closing connection

david allen
Ranch Hand

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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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
 
 
subject: Closing connection
 
Similar Threads
Try/catch variable scope
jdo and eclipse
J2ee app gets stuck at a stored procedure call
enterprise application with many users
connection