code: public boolean getAutoCommit() throws SQLException {
          Statement stmt = createStatement();
          ResultSet rs = stmt.executeQuery("select @@autocommit");
          rs.next();
          boolean autocommit = rs.getBoolean(1);
          rs.close();
          stmt.close();
          return autocommit;
      }
docs: returns true if statements on this connection are auto commited.
  
  @return true if auto commit is on.
  @throws SQLException