/** Set the JDBC DataSource to be used by this DAO. */ @Autowired public final void setDataSource(DataSource dataSource) { if (this.jdbcTemplate == null || dataSource != this.jdbcTemplate.getDataSource()) { this.jdbcTemplate = createJdbcTemplate(dataSource); initTemplateConfig(); } }
/** Set the JdbcTemplate for this DAO explicitly, as an alternative to specifying a DataSource. */ @Autowired public final void setJdbcTemplate(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; initTemplateConfig(); }