Here you can find the source of close(Connection conn)
public static void close(Connection conn)
//package com.java2s; //License from project: Open Source License import java.io.*; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class Main { /**//from w w w . j a v a 2 s. com * Close streams (in or out) * @param stream */ public static void close(Closeable stream) { if (stream != null) { try { if (stream instanceof Flushable) { ((Flushable) stream).flush(); } stream.close(); } catch (IOException e) { // When the stream is closed or interupted, can ignore this exception } } } public static void close(Connection conn) { if (conn != null) { try { conn.close(); } catch (SQLException e) { // When the conn is closed or interupted, can ignore this exception } } } public static void close(ResultSet rs) { if (rs != null) { try { rs.close(); } catch (SQLException e) { // When the file is closed already, can ignore this exception } } } public static void close(PreparedStatement ps) { if (ps != null) { try { ps.close(); } catch (SQLException e) { // When the file is closed already, can ignore this exception } } } }