Here you can find the source of close(Connection con)
public static void close(Connection con) throws SQLException
//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(); } }