Java Code Examples for org.springframework.jdbc.core.support.JdbcDaoSupport

The following are top voted examples for showing how to use org.springframework.jdbc.core.support.JdbcDaoSupport. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: bdf2   File: DataSourceRepository.java   Source Code and License 5 votes vote down vote up
public void afterPropertiesSet() throws Exception {
	Map<String, DataSourceRegister> dataSourceRegisters = applicationContext.getBeansOfType(DataSourceRegister.class);
	for (DataSourceRegister dataSourceRegister : dataSourceRegisters.values()) {
		dataSources.put(dataSourceRegister.getName(), dataSourceRegister.getDataSource());
		JdbcDaoSupport jdbcDaoSupport = new JdbcDaoSupport(){};
		jdbcDaoSupport.setDataSource(dataSourceRegister.getDataSource());
		jdbcTemplateMap.put(dataSourceRegister.getName(),jdbcDaoSupport.getJdbcTemplate());
		if(dataSourceRegister.isAsDefault()){
			defaultDataSourceName=dataSourceRegister.getName();
			this.defaultJdbcTemplate=jdbcDaoSupport.getJdbcTemplate();
		}
	}
}
 
Example 2
Project: bdf2   File: DataSourceRepository.java   Source Code and License 5 votes vote down vote up
public void afterPropertiesSet() throws Exception {
	Map<String, DataSourceRegister> dataSourceRegisters = applicationContext.getBeansOfType(DataSourceRegister.class);
	for (DataSourceRegister dataSourceRegister : dataSourceRegisters.values()) {
		dataSources.put(dataSourceRegister.getName(), dataSourceRegister.getDataSource());
		JdbcDaoSupport jdbcDaoSupport = new JdbcDaoSupport(){};
		jdbcDaoSupport.setDataSource(dataSourceRegister.getDataSource());
		jdbcTemplateMap.put(dataSourceRegister.getName(),jdbcDaoSupport.getJdbcTemplate());
		if(dataSourceRegister.isAsDefault()){
			defaultDataSourceName=dataSourceRegister.getName();
			this.defaultJdbcTemplate=jdbcDaoSupport.getJdbcTemplate();
		}
	}
}