mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
一次性修改数据
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.xboe.datasource;
|
||||
|
||||
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
|
||||
@Configuration
|
||||
public class DataSourceConfiguration {
|
||||
|
||||
@Primary
|
||||
@Bean(name="basicDataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.db1")
|
||||
public DataSource primaryDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
@Bean(name="primaryDataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.db2")
|
||||
public DataSource secondaryDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user