Here you can find the source of close(Connection conn)
Parameter | Description |
---|---|
conn | the conn |
public static void close(Connection conn)
//package com.java2s; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; public class Main { /**//www. java2 s . c o m * Close. * * @param conn * the conn */ public static void close(Connection conn) { if (conn != null) try { conn.close(); } catch (Exception e) { } } /** * Close. * * @param stmt * the stmt */ public static void close(Statement stmt) { if (stmt != null) try { stmt.close(); } catch (Exception e) { } } /** * Close. * * @param rs * the rs */ public static void close(ResultSet rs) { if (rs != null) try { rs.close(); } catch (Exception e) { } } /** * Close. * * @param ps * the ps */ public static void close(PreparedStatement ps) { if (ps != null) try { ps.close(); } catch (Exception e) { } } /** * Close. * * @param conn * the conn * @param ps * the ps */ public static void close(Connection conn, PreparedStatement ps) { close(ps); close(conn); } /** * Close. * * @param conn * the conn * @param stmt * the stmt */ public static void close(Connection conn, Statement stmt) { close(stmt); close(conn); } /** * Close. * * @param conn * the conn * @param ps * the ps * @param rs * the rs */ public static void close(Connection conn, PreparedStatement ps, ResultSet rs) { close(rs); close(ps); close(conn); } /** * Close. * * @param conn * the conn * @param stmt * the stmt * @param rs * the rs */ public static void close(Connection conn, Statement stmt, ResultSet rs) { close(rs); close(stmt); close(conn); } /** * Close. * * @param ps * the ps * @param rs * the rs */ public static void close(PreparedStatement ps, ResultSet rs) { close(rs); close(ps); } /** * Close. * * @param stmt * the stmt * @param rs * the rs */ public static void close(Statement stmt, ResultSet rs) { close(rs); close(stmt); } }