public final class MasterSlaveConnection extends AbstractConnectionAdapter
| 构造器和说明 |
|---|
MasterSlaveConnection() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
Statement |
createStatement() |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Collection<Connection> |
getConnection(SQLType sqlType)
Get database connections via SQL.
|
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) |
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> getConnection(SQLType sqlType) throws SQLException
DDL will return all connections; DQL will return slave connection; DML or updated before in same thread will return master connection.
sqlType - SQL typeSQLException - SQL exceptionpublic DatabaseMetaData getMetaData() 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 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 void close()
throws SQLException
close 在接口中 AutoCloseableclose 在接口中 Connectionclose 在类中 AbstractConnectionAdapterSQLExceptionCopyright © 2017. All rights reserved.