Here you can find the source of closeIfNotNull(Connection conn)
public static void closeIfNotNull(Connection conn)
//package com.java2s; //License from project: Open Source License import java.sql.*; public class Main { public static void closeIfNotNull(Connection conn) { if (conn == null) { return; }//from ww w . ja v a2s . c o m try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } public static void closeIfNotNull(PreparedStatement ps) { if (ps == null) { return; } try { ps.close(); } catch (SQLException e) { e.printStackTrace(); } } }