Here you can find the source of closeAll(ResultSet rs, Statement stmt, Connection conn)
public static void closeAll(ResultSet rs, Statement stmt, Connection conn)
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; public class Main { public static void closeAll(ResultSet rs, Statement stmt, Connection conn) { close(rs);/*from w w w . ja va 2 s . c om*/ close(stmt); close(conn); } private static void close(AutoCloseable conn) { if (conn != null) { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } conn = null; } } }