Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ec2a668

Browse files
author
何惠民
committed
Completed Druid configuration
1 parent 267e9c1 commit ec2a668

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929
compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1')
3030
compile('org.springframework.boot:spring-boot-starter-web')
3131
compile('org.springframework.boot:spring-boot-starter-aop')
32-
compile('com.alibaba:druid-spring-boot-starter:1.1.2')
32+
compile('com.alibaba:druid-spring-boot-starter:1.1.6')
3333
runtime('mysql:mysql-connector-java')
3434
testCompile('org.springframework.boot:spring-boot-starter-test')
3535
}

‎src/main/java/cn/com/hellowood/dynamicdatasource/configuration/DataSourceConfigurer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class DataSourceConfigurer {
3131
*/
3232
@Bean("master")
3333
@Primary
34-
@ConfigurationProperties(prefix = "application.server.db.master")
34+
@ConfigurationProperties(prefix = "spring.datasource.druid.master")
3535
public DataSource master() {
3636
return DataSourceBuilder.create().build();
3737
}
@@ -42,7 +42,7 @@ public DataSource master() {
4242
* @return the data source
4343
*/
4444
@Bean("slaveAlpha")
45-
@ConfigurationProperties(prefix = "application.server.db.slave-alpha")
45+
@ConfigurationProperties(prefix = "spring.datasource.druid.slave-alpha")
4646
public DataSource slaveAlpha() {
4747
return DataSourceBuilder.create().build();
4848
}
@@ -53,7 +53,7 @@ public DataSource slaveAlpha() {
5353
* @return the data source
5454
*/
5555
@Bean("slaveBeta")
56-
@ConfigurationProperties(prefix = "application.server.db.slave-beta")
56+
@ConfigurationProperties(prefix = "spring.datasource.druid.slave-beta")
5757
public DataSource slaveBeta() {
5858
return DataSourceBuilder.create().build();
5959
}
@@ -64,7 +64,7 @@ public DataSource slaveBeta() {
6464
* @return the data source
6565
*/
6666
@Bean("slaveGamma")
67-
@ConfigurationProperties(prefix = "application.server.db.slave-gamma")
67+
@ConfigurationProperties(prefix = "spring.datasource.druid.slave-gamma")
6868
public DataSource slaveGamma() {
6969
return DataSourceBuilder.create().build();
7070
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /