private void applyAdHocFilterToManualSqlStatement(CROM rootTable, String adHocFilter, String manualSql)
throws ExternalDatabaseException {
try {
SqlStatementParser parser = new SqlStatementParser(manualSql);
String newSql = parser.replaceFilter(adHocFilter);
((CROM_DB) rootTable.getExtension()).setManualSqlStatement(newSql);
} catch (Exception ex) {
throw new ExternalDatabaseException("Jitterbit could not modify the manual SQL statement by adding " +
"the filter \"" + adHocFilter + "\". This is a bug. Please report it to Jitterbit Support.", ex);
}