Class AbstractRoutingDataSource
java.lang.Object
com.baomidou.dynamic.datasource.ds.AbstractDataSource
com.baomidou.dynamic.datasource.ds.AbstractRoutingDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
- Direct Known Subclasses:
DynamicRoutingDataSource
抽象动态获取数据源
- Since:
- 2.2.0
- Author:
- TaoYu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract DataSource抽象获取连接池getConnection(String username, String password) protected abstract String获取默认数据源名称booleanisWrapperFor(Class<?> iface) <T> TMethods inherited from class com.baomidou.dynamic.datasource.ds.AbstractDataSource
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
AbstractRoutingDataSource
public AbstractRoutingDataSource()
-
-
Method Details
-
determineDataSource
抽象获取连接池- Returns:
- 连接池
-
getPrimary
获取默认数据源名称- Returns:
- 名称
-
getConnection
- Throws:
SQLException
-
getConnection
- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Overrides:
unwrapin classAbstractDataSource- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Overrides:
isWrapperForin classAbstractDataSource- Throws:
SQLException
-