/** * Add a SQL statement to the history. * * @param sql the SQL statement */ 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. * * @param sql the SQL statement */ 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. * * @param sql the SQL statement */ 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); } }