public class ShardingDataSource extends AbstractDataSourceAdapter implements AutoCloseable
Constructor and Description |
---|
ShardingDataSource(Map<String,DataSource> dataSourceMap,
ShardingRule shardingRule) |
ShardingDataSource(Map<String,DataSource> dataSourceMap,
ShardingRule shardingRule,
Map<String,Object> configMap,
Properties props) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
ShardingConnection |
getConnection() |
void |
renew(Map<String,DataSource> newDataSourceMap,
ShardingRule newShardingRule,
Properties newProps)
Renew sharding data source.
|
getConnection, getDatabaseType, getLogWriter, getParentLogger, setLogWriter
getLoginTimeout, setLoginTimeout
isWrapperFor, recordMethodInvocation, replayMethodsInvocation, throwSQLExceptionIfNecessary, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isWrapperFor, unwrap
public ShardingDataSource(Map<String,DataSource> dataSourceMap, ShardingRule shardingRule) throws SQLException
SQLException
public ShardingDataSource(Map<String,DataSource> dataSourceMap, ShardingRule shardingRule, Map<String,Object> configMap, Properties props) throws SQLException
SQLException
public void renew(Map<String,DataSource> newDataSourceMap, ShardingRule newShardingRule, Properties newProps)
newDataSourceMap
- new data source mapnewShardingRule
- new sharding rulenewProps
- new sharding propertiespublic ShardingConnection getConnection()
getConnection
in interface DataSource
public void close()
close
in interface AutoCloseable
Copyright © 2018. All rights reserved.