类 MultiHostMySQLConnection

  • 所有已实现的接口:
    JdbcConnection, MysqlConnection, TransactionEventHandler, AutoCloseable, Connection, Wrapper
    直接已知子类:
    LoadBalancedMySQLConnection, ReplicationMySQLConnection

    public class MultiHostMySQLConnection
    extends Object
    implements JdbcConnection
    Each instance of MultiHostMySQLConnection is coupled with a MultiHostConnectionProxy instance. While this class implements MySQLConnection directly, MultiHostConnectionProxy does the same but via a dynamic proxy. Most of the methods in this class refer directly to the active connection from its MultiHostConnectionProxy pair, providing a non-proxied access to the current active connection managed by this multi-host structure. The remaining methods either implement some local behavior or refer to the proxy itself instead of the sub-connection. Referring to the higher level proxy connection is needed when some operation needs to be extended to all open sub-connections existing in this multi-host structure as opposed to just refer to the active current connection, such as with close() which is most likely required to close all sub-connections as well.