Here you can find the source of closeResultSetAndStatement(ResultSet rs)
public static void closeResultSetAndStatement(ResultSet rs)
//package com.java2s; //License from project: Apache License import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { public static void closeResultSetAndStatement(ResultSet rs) { closeResultSet(rs);//from ww w . j av a 2 s .c om try { closeStatement(rs.getStatement()); } catch (SQLException e) { } } public static void closeResultSet(ResultSet rs) { try { rs.close(); } catch (SQLException e) { } } public static void closeStatement(Statement stmt) { if (stmt != null) { try { stmt.close(); } catch (SQLException e) { } } } }