public void setAutoCommit(final boolean autoCommit) throws SQLException {
        Statement stmt = createStatement();
        String clause;

        if(autoCommit) {
            clause = "1";
        } else {
            clause = "0";
        }

        stmt.executeUpdate("set autocommit="+clause);
    }
public void setAutoCommit ( final boolean autoCommit ) throws SQLException { Statement stmt = createStatement ( ) ; String clause ; if ( autoCommit ) { clause = "1" ; } else { clause = "0" ; } stmt . executeUpdate ( "set autocommit=" + clause ) ; }
Sets whether this connection is auto commited.

@param autoCommit if it should be auto commited.
@throws SQLException if something goes wrong talking to the server.