Here you can find the source of closeAll(ResultSet rset, Statement stmt, Connection conn)
public static void closeAll(ResultSet rset, Statement stmt, Connection conn)
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { /**// w ww . j av a 2s . c o m * Close a resultset, statement, and connection returning pooled * objects to their respective pools. */ public static void closeAll(ResultSet rset, Statement stmt, Connection conn) { close(rset); close(stmt); close(conn); } /** * Close a resultset and statement returning pooled objects to * their respective pools. */ public static void closeAll(ResultSet rset, Statement stmt) { close(rset); close(stmt); } /** * Close a resultset and its associated statement and connection * returning pooled objects to their respective pools. */ public static void closeAll(ResultSet rset) { try { Statement stmt = rset.getStatement(); close(rset); closeAll(stmt); } catch (SQLException se) { } } /** * Close a statement and its associated connection returning * pooled objects to their respective pools. */ public static void closeAll(Statement stmt) { try { Connection conn = stmt.getConnection(); close(stmt); close(conn); } catch (SQLException se) { } } /** * Close the given result set. */ public static void close(ResultSet rset) { if (rset != null) { try { rset.close(); } catch (SQLException e) { } } } /** * Close the given statement. */ public static void close(Statement stmt) { if (stmt != null) { try { stmt.close(); } catch (SQLException e) { } } } /** * Close a connection returning it to the pool. */ public static void close(Connection conn) { if (conn != null) { try { conn.close(); } catch (SQLException e) { } } } }