Java JDBC Collection Transaction rollbackAndCloseQuietly(Connection conn)

Here you can find the source of rollbackAndCloseQuietly(Connection conn)

Description

rollback And Close Quietly

License

Open Source License

Declaration

public static void rollbackAndCloseQuietly(Connection conn) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.*;

public class Main {
    public static void rollbackAndCloseQuietly(Connection conn) {
        try {/* ww w . j  a  va2  s.co  m*/
            rollbackAndClose(conn);
        } catch (SQLException var2) {
            ;
        }

    }

    public static void rollbackAndClose(Connection conn) throws SQLException {
        if (conn != null) {
            try {
                conn.rollback();
            } finally {
                conn.close();
            }
        }

    }

    public static void rollback(Connection conn) throws SQLException {
        if (conn != null) {
            conn.rollback();
        }

    }

    public static void close(Connection conn) throws SQLException {
        if (conn != null) {
            conn.close();
        }

    }

    public static void close(ResultSet rs) throws SQLException {
        if (rs != null) {
            rs.close();
        }

    }

    public static void close(Statement stmt) throws SQLException {
        if (stmt != null) {
            stmt.close();
        }

    }
}

Related

  1. rollback(Connection connection)
  2. rollback(Connection sqlConn)
  3. rollback(final Connection conn, final Logger logger)
  4. rollback(final Connection connection)
  5. rollbackAndClose(Connection con)
  6. rollbackQuietly(Connection conn)
  7. rollbackQuietly(Connection conn)
  8. rollbackQuietly(Connection connection)
  9. safeCommit(Connection conn)