public class DynamicDataSource
extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
| 构造器和说明 |
|---|
DynamicDataSource() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
protected Object |
determineCurrentLookupKey() |
static void |
reset()
重置当前栈
|
static void |
useMaster()
选择使用主库,并把选择放到当前ThreadLocal的栈顶
|
static void |
useSlave()
选择使用从库,并把选择放到当前ThreadLocal的栈顶
|
determineTargetDataSource, getConnection, getConnection, isWrapperFor, resolveSpecifiedDataSource, resolveSpecifiedLookupKey, setDataSourceLookup, setDefaultTargetDataSource, setLenientFallback, setTargetDataSources, unwrappublic static void useMaster()
public static void useSlave()
public static void reset()
public void afterPropertiesSet()
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanafterPropertiesSet 在类中 org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSourceprotected Object determineCurrentLookupKey()
determineCurrentLookupKey 在类中 org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSourceCopyright © 2019. All rights reserved.