public class DynamicDataSource
extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
多数据源的配置,并支持多从库
| 构造器和说明 |
|---|
DynamicDataSource() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected Object |
determineCurrentLookupKey()
如果是选择使用数据库
|
static void |
reset()
重置
|
static void |
use(String key,
int dbSize)
选择使用数据库,并把选择放到当前ThreadLocal的栈顶
|
afterPropertiesSet, determineTargetDataSource, getConnection, getConnection, isWrapperFor, resolveSpecifiedDataSource, resolveSpecifiedLookupKey, setDataSourceLookup, setDefaultTargetDataSource, setLenientFallback, setTargetDataSources, unwrappublic static void use(String key, int dbSize)
public static void reset()
protected Object determineCurrentLookupKey()
determineCurrentLookupKey 在类中 org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSourceCopyright © 2016. All rights reserved.