In between the two DB interactions you can close the resultset
but not the statement object
.
But it is not advisable to close the resultset and statement objects within try block.
you can try the below code:
finally{
if(rs!=null)
rs.close();
if(stmt!=null)
stmt.close();
}