Java JDBC Collection Transaction setAutoCommitEL(Connection conn, boolean b)

Here you can find the source of setAutoCommitEL(Connection conn, boolean b)

Description

set Auto Commit EL

License

LGPL

Declaration

public static void setAutoCommitEL(Connection conn, boolean b) 

Method Source Code


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

import java.sql.Connection;

public class Main {
    public static void setAutoCommitEL(Connection conn, boolean b) {
        /*try {//from  w  w  w.  ja  v  a2  s.  c  o m
           if(conn!=null){
        if(conn.getAutoCommit()==b) return;
           }
        } 
        catch (Throwable e) {}*/

        try {

            if (conn != null)
                conn.setAutoCommit(b);
        } catch (Throwable e) {
        }
    }
}

Related

  1. rollbackQuietly(Connection conn)
  2. rollbackQuietly(Connection connection)
  3. safeCommit(Connection conn)
  4. setAutoCommit(Connection conn, boolean autoCommit)
  5. setAutoCommit(final Connection connection, final boolean value)
  6. setAutoCommitMode(Connection conn, boolean autoCommit)