Java JDBC Collection Transaction rollbackQuietly(Connection connection)

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

Description

rollback a connection quietly

License

Apache License

Parameter

Parameter Description
connection a parameter

Declaration

public static void rollbackQuietly(Connection connection) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright 2012 Internet2//from   www. j  a  v a 2  s.  c  o m
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

import java.sql.Connection;

public class Main {
    /**
     * rollback a connection quietly
     * @param connection
     */
    public static void rollbackQuietly(Connection connection) {
        if (connection != null) {
            try {
                connection.rollback();
            } catch (Exception e) {
                //ignore
            }
        }
    }
}

Related

  1. rollback(final Connection connection)
  2. rollbackAndClose(Connection con)
  3. rollbackAndCloseQuietly(Connection conn)
  4. rollbackQuietly(Connection conn)
  5. rollbackQuietly(Connection conn)
  6. safeCommit(Connection conn)
  7. setAutoCommit(Connection conn, boolean autoCommit)
  8. setAutoCommit(final Connection connection, final boolean value)
  9. setAutoCommitEL(Connection conn, boolean b)