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

Appearance settings

keepmoving1573/springboot-multiple-dataSources

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

springboot-multiple-dataSources

前言

spring-boot多数据源自动切换例子项目, 利用spring aop 切面,自动切换数据源。

CommonServiceImpl是公共处理类,Test1ServiceImpl和Test2ServiceImpl是两个数据源分别的业务处理类。定义DataSourceAspect类处理切面。

springboot-multiple-dataSources/src/main/resources目录下的database1.sql和database2.sql是2个数据源初始化脚本

软件环境

IntelliJ IDEA 2016.3.3(或eclipse)

jdk 1.8

maven 3.3.9

使用的技术

在IDE 中查看源码并运行

1. 在IntelliJ IDEA (推荐使用)

File -> Import Project -> select springboot-multiple-dataSources folder -> create project form existing sources -> ...

2. 在Eclipse

File -> Import -> Existing Maven Projects -> ...

About

This is an example of automatically switching data sources for spring boot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.