Java JDBC Connection Close close(Connection con)

Here you can find the source of close(Connection con)

Description

close

License

Open Source License

Declaration

public static void close(Connection con) throws SQLException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.sql.Connection;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;

public class Main {

    public static void close(Connection con) throws SQLException {
        if (con != null)
            con.close();//from   w  ww  .j  a v  a2s. c om
    }

    public static void close(PreparedStatement pst, Connection con) throws SQLException {
        if (pst != null)
            pst.close();
        if (con != null)
            con.close();
    }

    public static void close(Statement st, Connection con) throws SQLException {
        if (st != null)
            st.close();
        if (con != null)
            con.close();
    }
}

Related

  1. close(Connection con)
  2. close(Connection conn)
  3. close(Connection conn)
  4. close(Connection conn)