I'm now using Oracle with Java. Here my point of view :
You should close ResultSet
and Statement
explicitly because Oracle has problems previously with keeping the cursors open even after closing the connection. If you don't close the ResultSet
(cursor) it will throw an error like Maximum open cursors exceeded.
I think you may encounter with the same problem with other databases you use.
Here is tutorial Close ResultSet when finished:
Close ResultSet when finished
Close
ResultSet
object as soon as you finish working withResultSet
object even thoughStatement
object closes theResultSet
object implicitly when it closes, closingResultSet
explicitly gives chance to garbage collector to recollect memory as early as possible becauseResultSet
object may occupy lot of memory depending on query.
ResultSet.close();