File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Closing connection