Reputation: 274522
In an in-memory database, is it necessary to close ResultSets, Statements and Connections?
My Java program uses HSQLDB to create a "memory table" and populate it with data, which it later queries. There is no persistence. Everything is done in memory. The program is single-threaded and only has one database connection (i.e. no database connection pooling).
Upvotes: 1
Views: 364
Reputation: 92752
Plus, it's good practice to clean up after yourself, so you have a better view of "what I'm working with now".
Upvotes: 0
Reputation: 597016
It's always best to close your jdbc objects - otherwise you risk memory leaks.
Read (at least) items 6 and 7 from Effective Java, Chapter 2 - they are more or less related.
Upvotes: 2