Skip to content

Commit c8b75e1

Browse files
Merge branch 'master' of github.com:heikehuan/springboot-multiple-dataSources
2 parents 1afe11e + f50610f commit c8b75e1

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

Diff for: README.md

+31-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
# springboot-multiple-dataSources
2-
spring-boot多数据源自动切换例子项目
32

4-
这个项目用到了通用mapper
3+
### 前言 ###
4+
5+
spring-boot多数据源自动切换例子项目, 利用spring aop 切面,自动切换数据源。
6+
7+
CommonServiceImpl是公共处理类,Test1ServiceImpl和Test2ServiceImpl是两个数据源分别的业务处理类。定义DataSourceAspect类处理切面。
8+
9+
springboot-multiple-dataSources/src/main/resources目录下的database1.sql和database2.sql是2个数据源初始化脚本
10+
11+
### 软件环境 ###
12+
IntelliJ IDEA 2016.3.3(或eclipse)
13+
14+
jdk 1.8
15+
16+
maven 3.3.9
17+
18+
### 使用的技术 ###
19+
20+
- spring-boot
21+
- springmvc
22+
- mybatis
23+
- 通用mapper(一个非常好用的mybatis插件, 详细介绍见http://git.oschina.net/free/Mapper)
24+
25+
### 在IDE 中查看源码并运行 ###
26+
27+
**1. 在IntelliJ IDEA (推荐使用)**
28+
29+
File -> Import Project -> select springboot-multiple-dataSources folder -> create project form existing sources -> ...
30+
31+
**2. 在Eclipse**
32+
33+
File -> Import -> Existing Maven Projects -> ...

Diff for: pom.xml

-14
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@
7575
<groupId>org.springframework.boot</groupId>
7676
<artifactId>spring-boot-starter-freemarker</artifactId>
7777
</dependency>
78-
79-
<!--上传文件-->
80-
<dependency>
81-
<groupId>commons-fileupload</groupId>
82-
<artifactId>commons-fileupload</artifactId>
83-
<version>1.3.1</version>
84-
</dependency>
85-
8678
<!--mysql-->
8779
<dependency>
8880
<groupId>mysql</groupId>
@@ -115,12 +107,6 @@
115107
<scope>compile</scope>
116108
<optional>true</optional>
117109
</dependency>
118-
<!--分页插件-->
119-
<dependency>
120-
<groupId>com.github.pagehelper</groupId>
121-
<artifactId>pagehelper</artifactId>
122-
<version>${pagehelper.version}</version>
123-
</dependency>
124110
<!--通用Mapper-->
125111
<dependency>
126112
<groupId>tk.mybatis</groupId>

0 commit comments

Comments
 (0)