public void checkAutoCommit(byte[] data, int len) {
    if (len < 6 || len > 30)
      return;

    String s = new String(data, 5, len - 5);
    s = s.toLowerCase();
    s = s.replaceAll("\\s", "");
    if (s.contentEquals("setautocommit=0"))
      autoCommit = false;
    else if (s.contentEquals("setautocommit=1"))
      autoCommit = true;

    if (autoCommit) {
      if (s.contentEquals("begin") || s.contentEquals("starttransaction")) {
        tempAutoCommit = false;
      }
      if (s.contentEquals("commit") || s.contentEquals("rollback")) {
        tempAutoCommit = true;
      }
    }

  }