Class MultiHostMySQLConnection

java.lang.Object
com.mysql.jdbc.MultiHostMySQLConnection
All Implemented Interfaces:
Connection, ConnectionProperties, MySQLConnection, AutoCloseable, Connection, Wrapper
Direct Known Subclasses:
JDBC4MultiHostMySQLConnection, LoadBalancedMySQLConnection, ReplicationMySQLConnection

public class MultiHostMySQLConnection extends Object implements MySQLConnection
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.