public final class ShardingSphereDataSource extends AbstractDataSourceAdapter implements AutoCloseable
| Constructor and Description |
|---|
ShardingSphereDataSource(String schemaName,
org.apache.shardingsphere.infra.config.mode.ModeConfiguration modeConfig) |
ShardingSphereDataSource(String schemaName,
org.apache.shardingsphere.infra.config.mode.ModeConfiguration modeConfig,
Map<String,DataSource> dataSourceMap,
Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> ruleConfigs,
Properties props) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
close(Collection<String> dataSourceNames)
Close data sources.
|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
void |
setLoginTimeout(int seconds) |
getParentLoggerisWrapperFor, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLogWriter, setLogWriterisWrapperFor, unwrappublic ShardingSphereDataSource(String schemaName, org.apache.shardingsphere.infra.config.mode.ModeConfiguration modeConfig) throws SQLException
SQLExceptionpublic ShardingSphereDataSource(String schemaName, org.apache.shardingsphere.infra.config.mode.ModeConfiguration modeConfig, Map<String,DataSource> dataSourceMap, Collection<org.apache.shardingsphere.infra.config.RuleConfiguration> ruleConfigs, Properties props) throws SQLException
SQLExceptionpublic Connection getConnection()
getConnection in interface DataSourcepublic Connection getConnection(String username, String password)
getConnection in interface DataSourcepublic void close(Collection<String> dataSourceNames) throws Exception
dataSourceNames - data source names to be closedException - exceptionpublic void close()
throws Exception
close in interface AutoCloseableExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.