I tried to close the DB connection.But had a bit of confusion, say
ResultSet rs = null
Whether I have to it close by
rs.c
I think the best way is do everything within a try-with-resources
try(conn=openConnection()){ try(rs=conn.getResultSet()){ } }
So that you be entirely sure the resources will be properly closed at the end.