public static void main(String args[]) {
    try {

      MqlParser p = null;

      if(args.length < 1) {
        System.out.println("Reading SQL from stdin (quit; or exit; to quit)");
        p = new MqlParser(System.in);
      } else {
        p = new MqlParser(new DataInputStream(new FileInputStream(args[0])));
      }

      // Read all SQL statements from input
      MStatement st;
      while((st = p.readStatement()) != null) {

        System.out.println(st.toString()); // Display the statement

        if(st instanceof MQuery) { // An SQL query: query the DB
          handleQuery((MQuery)st);
        } else if(st instanceof MInsert) { // An SQL insert
          handleInsert((MInsert)st);
        } else if(st instanceof MUpdate) {
          handleUpdate((MUpdate)st);
        } else if(st instanceof MDelete) {
          handleDelete((MDelete)st);
        }
      }

    } catch(Exception e) {
      e.printStackTrace();
    }
  }