Here you can find the source of closeResultSetAndStatement(Statement statement, ResultSet resultSet)
public static void closeResultSetAndStatement(Statement statement, ResultSet resultSet) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.ResultSet; import java.sql.SQLException; import com.mysql.jdbc.Statement; public class Main { public static void closeResultSetAndStatement(Statement statement, ResultSet resultSet) throws SQLException { if (statement != null) { statement.close();/*from w w w. j av a2 s .c om*/ } if (resultSet != null) { resultSet.close(); } } }