List of utility methods to do JDBC Connection Close
void | close(Connection connection) Closes the sql connection. if (connection != null) { try { connection.close(); } catch (SQLException e) { |
void | close(Connection rs) close rs.close(); |
void | close(Object obj) close if (obj instanceof ResultSet) { try { ((ResultSet) obj).close(); } catch (Exception e) { if (obj instanceof PreparedStatement) { try { ... |
void | closeConnection(Closeable... closes) close Connection for (Closeable close : closes) { try { if (close != null) { close.close(); } catch (IOException e) { e.printStackTrace(); |
void | closeIfNotNull(Connection conn) close If Not Null if (conn == null) { return; try { conn.close(); } catch (SQLException e) { e.printStackTrace(); |
void | closeJDBC(Object obj) Utility method to safety close various jdbc objects ResultSet, Statement, PreparedStatement if (obj == null) return; try { if (obj instanceof ResultSet) ((ResultSet) obj).close(); if (obj instanceof Statement) ((Statement) obj).close(); if (obj instanceof PreparedStatement) ... |
void | ClosePhase(long phaseId, Connection con) This method set status to close of specified phase. executeStatement(con, "UPDATE project_phase SET phase_status_id = 3 WHERE project_phase_id = " + phaseId);
|
void | closeQuietly(MongoClient mongoClient) close Quietly mongoClient.close(); |
void | closeResources(Object[] resources) close Resources for (Object resource : resources) { if (resource != null) { try { if (resource instanceof HttpURLConnection) { ((HttpURLConnection) resource).disconnect(); } else if (resource instanceof Closeable) { ((Closeable) resource).close(); } else if (resource instanceof Connection) { ... |
void | closeSilently(@WillClose Connection c) close Silently try { if (c != null) { c.close(); } catch (SQLException e) { assert true; |