Here you can find the source of closeAll(Connection conn, Statement stmt, ResultSet rs)
static void closeAll(Connection conn, Statement stmt, ResultSet rs)
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.Statement; import java.sql.ResultSet; import java.sql.SQLException; public class Main { static void closeAll(Connection conn, Statement stmt, ResultSet rs) { close(rs);/* www . j a v a 2 s. c o m*/ closeAll(conn, stmt); } static void closeAll(Connection conn, Statement stmt) { close(stmt); close(conn); } static void close(Connection conn) { try { if (conn != null) { conn.close(); } } catch (SQLException e) { //ignore } } static void close(Statement stmt) { try { if (stmt != null) { stmt.close(); } } catch (SQLException e) { // ignore } } static void close(ResultSet rs) { try { if (rs != null) { rs.close(); } } catch (SQLException e) { // ignore } } }