Java JDBC Collection Transaction rollback(Connection connection)

Here you can find the source of rollback(Connection connection)

Description

Undo all changes made by the Connection .

License

Apache License

Parameter

Parameter Description
connection a parameter

Exception

Parameter Description
SQLException an exception

Declaration

public static void rollback(Connection connection) throws SQLException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.sql.Connection;

import java.sql.SQLException;

public class Main {
    /**//from  w  w  w .j a  v  a2 s  .  c o  m
     * Undo all changes made by the {@link Connection}.
     * 
     * @param connection
     * @throws SQLException
     */
    public static void rollback(Connection connection) throws SQLException {
        if (connection != null && !connection.getAutoCommit()) {
            connection.rollback();
        }
    }
}

Related

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