JDBC is something every java developer often encounters in his day to day life. I really admire people who never forget to close a connection. But many of us are careful enough to close the resultset, statement as well as connection in the finally block, somewhat like below:
. . . ;
Do you think there is really a need of doing all this? The answer is no.
When you close a statement, the associated result set is automatically closed. Similarly if you close the connection, all statements of that connection are automatically closed.
So there is no need to close all the three, result set, statement and connection.