public final class BackendConnection extends Object implements AutoCloseable
| Constructor and Description |
|---|
BackendConnection(org.apache.shardingsphere.transaction.core.TransactionType transactionType) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ResultSet resultSet)
Add result set.
|
void |
add(Statement statement)
Add statement.
|
void |
close() |
void |
close(boolean forceClose)
Close cached connection.
|
List<Connection> |
getConnections(org.apache.shardingsphere.core.constant.ConnectionMode connectionMode,
String dataSourceName,
int connectionSize)
Get connections of current thread datasource.
|
int |
getConnectionSize()
Get connection size.
|
boolean |
isSerialExecute()
Whether execute SQL serial or not.
|
void |
setCurrentSchema(String schemaName)
Change logic schema of current channel.
|
void |
setTransactionType(org.apache.shardingsphere.transaction.core.TransactionType transactionType)
Change transaction type of current channel.
|
public BackendConnection(org.apache.shardingsphere.transaction.core.TransactionType transactionType)
public void setTransactionType(org.apache.shardingsphere.transaction.core.TransactionType transactionType)
transactionType - transaction typepublic void setCurrentSchema(String schemaName)
schemaName - schema namepublic 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 be getSQLException - SQL exceptionpublic boolean isSerialExecute()
public int getConnectionSize()
public void add(Statement statement)
statement - statement to be addedpublic void add(ResultSet resultSet)
resultSet - result set to be addedpublic void close()
throws SQLException
close in interface AutoCloseableSQLExceptionpublic void close(boolean forceClose)
throws SQLException
forceClose - force close flagSQLException - SQL exceptionCopyright © 2019 The Apache Software Foundation. All rights reserved.