aspose file tools*
The moose likes JDBC and the fly likes Re: Freeing of resources Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Re: Freeing of resources" Watch "Re: Freeing of resources" New topic
Author

Re: Freeing of resources

Ashwin Tadepalli
Greenhorn

Joined: Feb 01, 2001
Posts: 27
Hi,
I have a qusetion about freeing of resources when I am using JDBC code.My application works pretty well for sometime and after sometime it behaves in a weird manner.Basically my application involves servlets talking to backend database and retreiving the results back.To remedy for the solution I have to restart my application server and you know what it works pretty well this time.In my JDBC code I did not close my statement but I did close my connection and it works fine.Also I am using the CreateStatement() in a try block.Is it advisable to use it there or put it before the try statement,could anyone please let me know of what exactly is happening here.
Thanking you,
Ashwin
Angela Lamb
Ranch Hand

Joined: Feb 22, 2001
Posts: 156
You need to close your result sets and statements or the database resources will eventually be used up. This is usually done in a finally block.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Re: Freeing of resources
 
Similar Threads
JDBC Coonection Pooling in a multithreaded Web application
doubt about try catch finally and method return
timeout error
Shell Crashing
Connection.close() and preparedStatement.close() in Connection.TRANSACTION_SERIALIZABLE mode.