public final class ShardingConnection extends AbstractConnectionAdapter
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Constructor and Description |
|---|
ShardingConnection(Map<String,DataSource> dataSourceMap,
ShardingRuntimeContext runtimeContext,
TransactionType transactionType) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit() |
protected Connection |
createConnection(String dataSourceName,
DataSource dataSource) |
Statement |
createStatement() |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
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, getAutoCommit, getConnection, getConnections, getDataSourceMap, getHoldability, getTransactionIsolation, getWarnings, isClosed, isReadOnly, setHoldability, setReadOnly, setTransactionIsolationabort, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, getCatalog, getClientInfo, getClientInfo, getNetworkTimeout, getSchema, getTypeMap, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, releaseSavepoint, rollback, setCatalog, setClientInfo, setClientInfo, setNetworkTimeout, setSavepoint, setSavepoint, setSchema, setTypeMapisWrapperFor, recordMethodInvocation, replayMethodsInvocation, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisWrapperFor, unwrappublic ShardingConnection(Map<String,DataSource> dataSourceMap, ShardingRuntimeContext runtimeContext, TransactionType transactionType)
public boolean isHoldTransaction()
protected Connection createConnection(String dataSourceName, DataSource dataSource) throws SQLException
createConnection in class AbstractConnectionAdapterSQLExceptionpublic DatabaseMetaData getMetaData() throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
SQLExceptionpublic Statement createStatement()
public Statement createStatement(int resultSetType, int resultSetConcurrency)
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
public void setAutoCommit(boolean autoCommit)
throws SQLException
setAutoCommit in interface ConnectionsetAutoCommit in class AbstractConnectionAdapterSQLExceptionpublic void commit()
throws SQLException
commit in interface Connectioncommit in class AbstractConnectionAdapterSQLExceptionpublic void rollback()
throws SQLException
rollback in interface Connectionrollback in class AbstractConnectionAdapterSQLExceptionCopyright © 2020 The Apache Software Foundation. All rights reserved.