use of org.jumpmind.db.sql.ISqlTemplate in project symmetric-ds by JumpMind.
the class DefaultDatabaseWriter method bindVariables.
@Override
protected void bindVariables(Map<String, Object> variables) {
super.bindVariables(variables);
ISqlTemplate template = platform.getSqlTemplate();
Class<?> templateClass = template.getClass();
if (templateClass.getSimpleName().equals("JdbcSqlTemplate")) {
try {
Method method = templateClass.getMethod("getDataSource");
variables.put("DATASOURCE", method.invoke(template));
} catch (Exception e) {
log.warn("Had trouble looking up the datasource used by the sql template", e);
}
}
}
Aggregations