com.mysql.cj.jdbc.ha

## Interface ReplicationConnection

All Superinterfaces:
  AutoCloseable, Connection, JdbcConnection, MysqlConnection, TransactionEventHandler, Wrapper

    public interface ReplicationConnection
    extends JdbcConnection

### Field Summary

### Fields inherited from interface java.sql.Connection

`TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE`

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `addReplicaHost(String host)`
`long` `getConnectionGroupId()`
`JdbcConnection` `getCurrentConnection()`
`JdbcConnection` `getReplicaConnection()`
`JdbcConnection` `getSourceConnection()`
`boolean` `isHostReplica(String host)`
`boolean` `isHostSource(String host)`
`void` `promoteReplicaToSource(String host)`
`void` `removeReplica(String host)`
`void` `removeReplica(String host, boolean closeGently)`
`void` `removeSourceHost(String host)`
`void` `removeSourceHost(String host, boolean waitUntilNotInUse)`

### Methods inherited from interface com.mysql.cj.jdbc.JdbcConnection

`abortInternal, changeUser, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, decachePreparedStatement, doClose, getActiveMySQLConnection, getActiveStatementCount, getAutoIncrementIncrement, getCachedMetaData, getCharacterSetMetadata, getClientInfoProviderImpl, getDatabase, getHost, getHostPortPair, getIdleFor, getLock, getMetadataSafeStatement, getMultiHostParentProxy, getMultiHostSafeProxy, getPropertySet, getQueryInterceptorsInstances, getServerVersion, getSessionMaxRows, getStatementComment, hasSameProperties, initializeResultsMetadataFromCache, initializeSafeQueryInterceptors, isInGlobalTx, isProxySet, isReadOnly, isSameResource, isServerLocal, isSourceConnection, lowerCaseTableNames, ping, pingInternal, recachePreparedStatement, registerStatement, resetServerState, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, setDatabase, setFailedOver, setInGlobalTx, setProxy, setReadOnlyInternal, setSessionMaxRows, setStatementComment, shutdownServer, storesLowerCaseTableName, throwConnectionClosedException, unregisterStatement, unSafeQueryInterceptors`

### Methods inherited from interface java.sql.Connection

`abort, clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap`

### Methods inherited from interface java.sql.Wrapper

`isWrapperFor, unwrap`

### Methods inherited from interface com.mysql.cj.MysqlConnection

`checkClosed, cleanup, createNewIO, getConnectionLock, getExceptionInterceptor, getId, getProperties, getServerSessionStateController, getSession, getURL, getUser`

### Methods inherited from interface com.mysql.cj.TransactionEventHandler

`transactionBegun, transactionCompleted`

### Method Detail

#### getConnectionGroupId

    long getConnectionGroupId()

#### getCurrentConnection

    JdbcConnection getCurrentConnection()

#### getSourceConnection

    JdbcConnection getSourceConnection()

#### promoteReplicaToSource

    void promoteReplicaToSource(String host)
                         throws SQLException

Throws:
  `SQLException`

#### removeSourceHost

    void removeSourceHost(String host)
                   throws SQLException

Throws:
  `SQLException`

#### removeSourceHost

    void removeSourceHost(String host,
                          boolean waitUntilNotInUse)
                   throws SQLException

Throws:
  `SQLException`

#### isHostSource

    boolean isHostSource(String host)

#### getReplicaConnection

    JdbcConnection getReplicaConnection()

#### addReplicaHost

    void addReplicaHost(String host)
                 throws SQLException

Throws:
  `SQLException`

#### removeReplica

    void removeReplica(String host)
                throws SQLException

Throws:
  `SQLException`

#### removeReplica

    void removeReplica(String host,
                       boolean closeGently)
                throws SQLException

Throws:
  `SQLException`

#### isHostReplica

    boolean isHostReplica(String host)

Copyright © 2016, 2025, Oracle and/or its affiliates.