Here you can find the source of close(Connection conn)
public static void close(Connection conn)
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; public class Main { public static void close(Connection conn, PreparedStatement pstmt, ResultSet result) { //close connections. if (result != null) { try { result.close();/*from www .j a v a2s. c o m*/ } catch (Exception e) { e.printStackTrace(); } } if (pstmt != null) { try { pstmt.close(); } catch (Exception e) { e.printStackTrace(); } } if (conn != null) { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } } } public static void close(Connection conn, PreparedStatement pstmt) { //close connections. if (pstmt != null) { try { pstmt.close(); } catch (Exception e) { e.printStackTrace(); } } if (conn != null) { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } } } public static void close(Connection conn) { if (conn != null) { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } } } }