void addCommand(String sql){
  if (sql == null) {
    return;
  }
  sql=sql.trim();
  if (sql.length() == 0) {
    return;
  }
  if (commandHistory.size() > MAX_HISTORY) {
    commandHistory.remove(0);
  }
  int idx=commandHistory.indexOf(sql);
  if (idx >= 0) {
    commandHistory.remove(idx);
  }
  commandHistory.add(sql);
  if (server.isCommandHistoryAllowed()) {
    server.saveCommandHistoryList(commandHistory);
  }
}

void addCommand ( String sql ) { if ( sql == null ) { return ; } sql = sql . trim ( ) ; if ( sql . length ( ) == 0 ) { return ; } if ( commandHistory . size ( ) > MAX_HISTORY ) { commandHistory . remove ( 0 ) ; } int idx = commandHistory . indexOf ( sql ) ; if ( idx >= 0 ) { commandHistory . remove ( idx ) ; } commandHistory . add ( sql ) ; if ( server . isCommandHistoryAllowed ( ) ) { server . saveCommandHistoryList ( commandHistory ) ; } }
add a sql statement to the history .
