Java SQL ResultSet Close closeAll(ResultSet rs, Statement stmt, Connection conn)

Here you can find the source of closeAll(ResultSet rs, Statement stmt, Connection conn)

Description

close All

License

Open Source License

Declaration

public static void closeAll(ResultSet rs, Statement stmt, Connection conn) 

Method Source Code


//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;
        }
    }
}

Related

  1. closeAll(Connection con, PreparedStatement ps, ResultSet rs)
  2. closeAll(Connection conn, Statement stmt, ResultSet rs)
  3. closeAll(Connection conn, Statement stmt, ResultSet rs)
  4. closeAll(ResultSet rs)
  5. closeAll(ResultSet rs, Statement st, Connection conn)
  6. closeAll(ResultSet rs1, Statement stmt1)
  7. closeAll(ResultSet rset, Statement stmt, Connection conn)
  8. closeAllConnections(PreparedStatement preparedStatement, Connection connection, ResultSet resultSet)
  9. closeConnections(Connection conn, Statement st, ResultSet res)