public final class JDBCBackendDataSource extends Object implements BackendDataSource, AutoCloseable
| Constructor and Description |
|---|
JDBCBackendDataSource(Map<String,YamlDataSourceParameter> dataSourceParameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Connection |
getConnection(String dataSourceName)
Get connection.
|
List<Connection> |
getConnections(org.apache.shardingsphere.core.constant.ConnectionMode connectionMode,
String dataSourceName,
int connectionSize)
Get connections.
|
List<Connection> |
getConnections(org.apache.shardingsphere.core.constant.ConnectionMode connectionMode,
String dataSourceName,
int connectionSize,
org.apache.shardingsphere.transaction.core.TransactionType transactionType)
Get connections.
|
void |
renew(Map<String,YamlDataSourceParameter> dataSourceParameters)
Renew JDBC backend data source.
|
public JDBCBackendDataSource(Map<String,YamlDataSourceParameter> dataSourceParameters)
public Connection getConnection(String dataSourceName) throws SQLException
dataSourceName - data source nameSQLException - SQL exceptionpublic List<Connection> getConnections(org.apache.shardingsphere.core.constant.ConnectionMode connectionMode, String dataSourceName, int connectionSize) throws SQLException
connectionMode - connection modedataSourceName - data source nameconnectionSize - size of connections to getSQLException - SQL exceptionpublic List<Connection> getConnections(org.apache.shardingsphere.core.constant.ConnectionMode connectionMode, String dataSourceName, int connectionSize, org.apache.shardingsphere.transaction.core.TransactionType transactionType) throws SQLException
connectionMode - connection modedataSourceName - data source nameconnectionSize - size of connections to be gettransactionType - transaction typeSQLException - SQL exceptionpublic void close()
throws Exception
close in interface AutoCloseableExceptionpublic void renew(Map<String,YamlDataSourceParameter> dataSourceParameters) throws Exception
dataSourceParameters - data source parametersException - exceptionCopyright © 2019 The Apache Software Foundation. All rights reserved.