Skip to content

Commit 8f67bcd

Browse files
author
wangyibing
committed
。。。。
1 parent 49c6fd7 commit 8f67bcd

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

05data/data-demo/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@
4444
<groupId>org.springframework.boot</groupId>
4545
<artifactId>spring-boot-starter-jdbc</artifactId>
4646
</dependency>
47+
<!-- for spring boot -->
48+
<dependency>
49+
<groupId>org.apache.shardingsphere</groupId>
50+
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
51+
<version>4.1.1</version>
52+
</dependency>
53+
<!-- for spring namespace -->
54+
<dependency>
55+
<groupId>org.apache.shardingsphere</groupId>
56+
<artifactId>sharding-jdbc-spring-namespace</artifactId>
57+
<version>4.1.1</version>
58+
</dependency>
4759
<dependency>
4860
<groupId>org.springframework.boot</groupId>
4961
<artifactId>spring-boot-starter-web</artifactId>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
spring:
2+
shardingsphere:
3+
props:
4+
sql:
5+
show: true
6+
masterslave:
7+
name:
8+
master-data-source-name:
9+
slave-data-source-names:
10+
load-balance-algorithm-type: random
11+
datasource:
12+
names: master,slave0,slave1
13+
master:
14+
driverClassName: com.mysql.jdbc.Driver
15+
url: jdbc:mysql://localhost:3306/ds_master
16+
username: root
17+
password:
18+
type: org.apache.commons.dbcp.BasicDataSource
19+
20+
slave1:
21+
driverClassName: com.mysql.jdbc.Driver
22+
url: jdbc:mysql://localhost:3316/ds_master
23+
username: root
24+
password:
25+
type: org.apache.commons.dbcp.BasicDataSource
26+
27+
slave2:
28+
driverClassName: com.mysql.jdbc.Driver
29+
url: jdbc:mysql://localhost:3306/ds_master
30+
username: root
31+
password:
32+
type: org.apache.commons.dbcp.BasicDataSource
33+

0 commit comments

Comments
 (0)