public final class ShardingSphereDataSource extends AbstractUnsupportedOperationDataSource implements AutoCloseable
| Constructor and Description |
|---|
ShardingSphereDataSource(Map<String,DataSource> dataSourceMap,
Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> configurations,
Properties props) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
close(Collection<String> dataSourceNames)
Close dataSources.
|
ShardingSphereConnection |
getConnection() |
ShardingSphereConnection |
getConnection(String username,
String password) |
Map<String,DataSource> |
getDataSourceMap()
Get data sources.
|
getLoginTimeout, getParentLogger, setLoginTimeoutisWrapperFor, recordMethodInvocation, replayMethodsInvocation, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLogWriter, setLogWriterisWrapperFor, unwrappublic ShardingSphereDataSource(Map<String,DataSource> dataSourceMap, Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> configurations, Properties props) throws SQLException
SQLExceptionpublic ShardingSphereConnection getConnection()
getConnection in interface DataSourcepublic ShardingSphereConnection getConnection(String username, String password)
getConnection in interface DataSourcepublic Map<String,DataSource> getDataSourceMap()
public void close()
throws Exception
close in interface AutoCloseableExceptionpublic void close(Collection<String> dataSourceNames) throws Exception
dataSourceNames - data source namesException - exceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.