public final class ShardingConnection extends AbstractConnectionAdapter
| 构造器和说明 |
|---|
ShardingConnection() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
Statement |
createStatement() |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Collection<Connection> |
getAllConnections(String dataSourceName)
Get all database connections via data source name.
|
Connection |
getConnection(String dataSourceName,
SQLType sqlType)
Get database connection via data source name.
|
DatabaseMetaData |
getMetaData() |
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 |
release(Connection connection)
Release connection.
|
clearWarnings, commit, getAutoCommit, getHoldability, getTransactionIsolation, getWarnings, isClosed, isReadOnly, rollback, setAutoCommit, 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, throwSQLExceptionIfNecessary, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisWrapperFor, unwrappublic Collection<Connection> getAllConnections(String dataSourceName) throws SQLException
Master-slave connection will return all actual connections
dataSourceName - data source nameSQLException - SQL exceptionpublic Connection getConnection(String dataSourceName, SQLType sqlType) throws SQLException
dataSourceName - data source namesqlType - SQL typeSQLException - SQL exceptionpublic void release(Connection connection)
connection - to be released connectionpublic 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() throws SQLException
SQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
SQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
SQLExceptionpublic void close()
throws SQLException
close 在接口中 AutoCloseableclose 在接口中 Connectionclose 在类中 AbstractConnectionAdapterSQLExceptionCopyright © 2017. All rights reserved.