protected NamedParameterJdbcTemplate getJdbcTemplate(Object params) { DataSource targetDataSource = DataSourceContext.getDataSource(); if (targetDataSource == null) { return new NamedParameterJdbcTemplate(routeDataSource(routeConfigDefault, params)); } else { return new NamedParameterJdbcTemplate(targetDataSource); } }
protected NamedParameterJdbcTemplate getValidateJdbcTemplate(Object params) { DataSource targetDataSource = DataSourceContext.getDataSource(); DataSource routeDataSource = routeDataSource(routeConfigDefault, params); if (targetDataSource == null) { return new NamedParameterJdbcTemplate(routeDataSource); } if (!targetDataSource.equals(routeDataSource) && routeDataSource != null) { throw new RuntimeException( "Could not operate different DataSouce[" + targetDataSource + ", " + routeDataSource + "]"); } return new NamedParameterJdbcTemplate(targetDataSource); }