As java documentation say :
1. About Statement :
" It is generally good practice to release resources as soon as
you are finished with them to avoid tying up database"
2. About ResultSet
a) " A ResultSet object maintains a cursor pointingto its current row of data. " - we can see that resultSet keeps db cursor
b) "The closing of a ResultSet object does not close the Blob, Clob or NClob objects created by the ResultSet. Blob, Clob or NClob objects remain valid for at least the duration of thetransaction in which they are creataed, unless their free method is invoked. " - we can see that ResultSet keep some object which can keep memory - Possibly MemoryLeak
3. About Connection
a) method prepareStatement "Creates a PreparedStatement object " - it create new statement without closing the previous one
b) method close : "Releases this Connection object's database and JDBC resources immediately"