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
Both ways works, but I prefer the first rs.close(); , without forgeting to check if rs is not null and to enclose your call by a try..catch statement so you have to close your connection in the finaly block even if Java7 close all for you.
check Java / JDBC: Best design pattern to close database connection when exception occurs