Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


# MultipleDataSource
使用ssm框架,配置多数据源自动切换
## 说明
Expand Down Expand Up @@ -82,11 +84,11 @@ SpringBoot 版本 2.0.3
return multipleDataSource;
}
```
4. 如果需要切换数据源,则在指定的方法上加上`@DataSource`注解即可
4. 如果需要切换数据源,则在指定的方法上加上`@DataSource`注解即可,未标注时默认使用 `db1`
```java
@Override
@DataSource(DataSourceEnum.DB2)
public List<Student> selectList(Wrapper<Student> wrapper) {
return super.selectList(wrapper);
}
```
```