Here you can find the source of close(ResultSet rs, Statement stmt)
public static void close(ResultSet rs, Statement stmt)
//package com.java2s; //License from project: Apache License import java.sql.*; public class Main { public static void close(ResultSet rs, Statement stmt) { closeResultSet(rs);//from w w w .j a v a 2s.c o m closeStatement(stmt); } /** * Close the given JDBC ResultSet and ignore any thrown exception. * This is useful for typical finally blocks in manual JDBC code. * * @param rs the JDBC ResultSet to close (may be <code>null</code>) */ public static void closeResultSet(ResultSet rs) { if (rs != null) { try { rs.close(); } catch (SQLException ex) { // logger.debug("Could not close JDBC ResultSet", ex); } catch (Throwable ex) { // We don't trust the JDBC driver: It might throw RuntimeException or Error. // logger.debug("Unexpected exception on closing JDBC ResultSet", ex); } } } /** * Close the given JDBC Statement and ignore any thrown exception. * This is useful for typical finally blocks in manual JDBC code. * * @param stmt the JDBC Statement to close (may be <code>null</code>) */ public static void closeStatement(Statement stmt) { if (stmt != null) { try { stmt.close(); } catch (SQLException ex) { // logger.debug("Could not close JDBC Statement", ex); } catch (Throwable ex) { // We don't trust the JDBC driver: It might throw RuntimeException or Error. // logger.debug("Unexpected exception on closing JDBC Statement", ex); } } } }