make sure all the statements and result sets are closed