Here you can find the source of close(ResultSet rs, Statement ps, Connection conn)
public static void close(ResultSet rs, Statement ps, Connection conn)
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { public static void close(ResultSet rs, Statement ps, Connection conn) { try {//from ww w. j a va 2s .co m if (rs != null) { rs.close(); } } catch (SQLException e) { e.printStackTrace(); } try { if (ps != null) { ps.close(); } } catch (SQLException e) { e.printStackTrace(); } try { if (conn != null) { conn.close(); } } catch (SQLException e) { e.printStackTrace(); } } public static void close(Statement ps, Connection conn) { try { if (ps != null) { ps.close(); } } catch (SQLException e) { e.printStackTrace(); } try { if (conn != null) { conn.close(); } } catch (SQLException e) { e.printStackTrace(); } } public static void close(Connection conn) { try { if (conn != null) { conn.close(); } } catch (SQLException e) { e.printStackTrace(); } } }