public final class ShardingSphereConnection extends AbstractConnectionAdapter implements org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.ExecutorJDBCManager
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Constructor and Description |
|---|
ShardingSphereConnection(Map<String,DataSource> dataSourceMap,
MetaDataContexts metaDataContexts,
TransactionContexts transactionContexts,
TransactionType transactionType) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit() |
Array |
createArrayOf(String typeName,
Object[] elements) |
Statement |
createStatement() |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Statement |
createStorageResource(Connection connection,
org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode connectionMode,
org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption option) |
PreparedStatement |
createStorageResource(String sql,
List<Object> parameters,
Connection connection,
org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode connectionMode,
org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption option) |
boolean |
getAutoCommit() |
Connection |
getConnection(String dataSourceName)
Get database connection.
|
List<Connection> |
getConnections(String dataSourceName,
int connectionSize,
org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode connectionMode) |
DatabaseMetaData |
getMetaData() |
boolean |
isHoldTransaction()
Whether hold transaction or not.
|
PreparedStatement |
prepareStatement(String sql) |
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys) |
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes) |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency) |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
PreparedStatement |
prepareStatement(String sql,
String[] columnNames) |
void |
rollback() |
void |
setAutoCommit(boolean autoCommit) |
clearWarnings, close, getCatalog, getHoldability, getSchema, getTransactionIsolation, getWarnings, isClosed, isReadOnly, isValid, setCatalog, setHoldability, setReadOnly, setSchema, setTransactionIsolationabort, createBlob, createClob, createNClob, createSQLXML, createStruct, getClientInfo, getClientInfo, getNetworkTimeout, getTypeMap, nativeSQL, prepareCall, prepareCall, prepareCall, releaseSavepoint, rollback, setClientInfo, setClientInfo, setNetworkTimeout, setSavepoint, setSavepoint, setTypeMapisWrapperFor, recordMethodInvocation, replayMethodsInvocation, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisWrapperFor, unwrappublic ShardingSphereConnection(Map<String,DataSource> dataSourceMap, MetaDataContexts metaDataContexts, TransactionContexts transactionContexts, TransactionType transactionType)
public Connection getConnection(String dataSourceName) throws SQLException
dataSourceName - data source nameSQLException - SQL exceptionpublic List<Connection> getConnections(String dataSourceName, int connectionSize, org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode connectionMode) throws SQLException
getConnections in interface org.apache.shardingsphere.infra.executor.sql.prepare.driver.ExecutorDriverManager<Connection,Statement,org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption>SQLExceptionpublic boolean isHoldTransaction()
public Statement createStorageResource(Connection connection, org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode connectionMode, org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption option) throws SQLException
createStorageResource in interface org.apache.shardingsphere.infra.executor.sql.prepare.driver.ExecutorDriverManager<Connection,Statement,org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption>SQLExceptionpublic PreparedStatement createStorageResource(String sql, List<Object> parameters, Connection connection, org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode connectionMode, org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption option) throws SQLException
createStorageResource in interface org.apache.shardingsphere.infra.executor.sql.prepare.driver.ExecutorDriverManager<Connection,Statement,org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption>SQLExceptionpublic DatabaseMetaData getMetaData()
getMetaData in interface Connectionpublic PreparedStatement prepareStatement(String sql) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic Statement createStatement()
createStatement in interface Connectionpublic Statement createStatement(int resultSetType, int resultSetConcurrency)
createStatement in interface Connectionpublic Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
createStatement in interface Connectionpublic boolean getAutoCommit()
getAutoCommit in interface Connectionpublic void setAutoCommit(boolean autoCommit)
throws SQLException
setAutoCommit in interface ConnectionSQLExceptionpublic void commit()
throws SQLException
commit in interface ConnectionSQLExceptionpublic void rollback()
throws SQLException
rollback in interface ConnectionSQLExceptionpublic Array createArrayOf(String typeName, Object[] elements) throws SQLException
createArrayOf in interface ConnectionSQLExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.