示例#1
0
 /** 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();
   }
 }
示例#2
0
 /** 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();
 }