Java examples for java.sql:Transaction
set Connection Auto Commit
//package com.java2s; import java.sql.Connection; import java.sql.SQLException; public class Main { public static Boolean setAutoCommit(Connection conn, boolean commitStatus) { if (conn == null) { return true; }/*from ww w .j av a 2s. co m*/ try { boolean commit = conn.getAutoCommit(); conn.setAutoCommit(commitStatus); return commit; } catch (SQLException e1) { e1.printStackTrace(); return true; } } }