@Configuration public class EventDataSourceConfig { @Bean(name = "eventdataSource") @ConfigurationProperties(prefix="datasource.event") public DataSource oldDataSource() { return DataSourceBuilder.create().build(); } @Bean(name = "eventjdbcTemplate") public JdbcTemplate oldjdbcTemplate(@Qualifier("eventdataSource") DataSource dataSource) { return new JdbcTemplate(dataSource); } }
datasource: event:
标签:Java,spring,ConfigurationProperties,Bean,prefix,datasource,Configuration,public From: https://www.cnblogs.com/deepalley/p/17523126.html