Top Fields Constructors Methods
com.mysql.cj.jdbc.ha

public Class LoadBalancedMySQLConnection

extends MultiHostMySQLConnection
implements LoadBalancedConnection
Class Inheritance
All Implemented Interfaces
com.mysql.cj.jdbc.ha.LoadBalancedConnection, com.mysql.cj.jdbc.JdbcConnection, com.mysql.cj.TransactionEventHandler, com.mysql.cj.MysqlConnection, java.sql.Connection, java.lang.AutoCloseable, java.sql.Wrapper
Imports
java.sql.SQLException, com.mysql.cj.Messages, com.mysql.cj.exceptions.MysqlErrorNumbers, com.mysql.cj.jdbc.exceptions.SQLError

Field Summary

Inherited from com.mysql.cj.jdbc.ha.MultiHostMySQLConnection:
thisAsProxy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
close()

Overrides com.mysql.cj.jdbc.ha.MultiHostMySQLConnection.close.

Implements java.sql.Connection.close.

Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.

public LoadBalancedConnectionProxy
public boolean
isWrapperFor(Class<?>
a Class defining an interface.
iface
)

Overrides com.mysql.cj.jdbc.ha.MultiHostMySQLConnection.isWrapperFor.

Implements java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.

public void
ping()

Overrides com.mysql.cj.jdbc.ha.MultiHostMySQLConnection.ping.

Implements com.mysql.cj.jdbc.JdbcConnection.ping.

Detect if the connection is still good by sending a ping command to the server.

public void
ping(boolean allConnections)

Implements com.mysql.cj.jdbc.ha.LoadBalancedConnection.ping.

public void
public void
public <T> T
unwrap(Class<T>
A Class defining an interface that the result must implement.
iface
)

Overrides com.mysql.cj.jdbc.ha.MultiHostMySQLConnection.unwrap.

Implements java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.

Inherited from com.mysql.cj.jdbc.ha.MultiHostMySQLConnection:
abortabortInternalchangeUsercheckClosedcleanupclearWarningsclientPrepareStatementclientPrepareStatementclientPrepareStatementclientPrepareStatementclientPrepareStatementclientPrepareStatementcommitcreateArrayOfcreateBlobcreateClobcreateNClobcreateNewIOcreateSQLXMLcreateStatementcreateStatementcreateStatementcreateStructdecachePreparedStatementdoClosegetActiveMySQLConnectiongetActiveStatementCountgetAutoCommitgetAutoIncrementIncrementgetCachedMetaDatagetCataloggetCharacterSetMetadatagetClientInfogetClientInfogetClientInfoProviderImplgetConnectionLockgetDatabasegetExceptionInterceptorgetHoldabilitygetHostgetHostPortPairgetIdgetIdleForgetLockgetMetaDatagetMetadataSafeStatementgetMultiHostParentProxygetMultiHostSafeProxygetNetworkTimeoutgetPropertiesgetPropertySetgetQueryInterceptorsInstancesgetSchemagetServerSessionStateControllergetServerVersiongetSessiongetSessionMaxRowsgetStatementCommentgetTransactionIsolationgetTypeMapgetURLgetUsergetWarningshasSamePropertiesinitializeResultsMetadataFromCacheinitializeSafeQueryInterceptorsisClosedisInGlobalTxisProxySetisReadOnlyisReadOnlyisSameResourceisServerLocalisSourceConnectionisValidlowerCaseTableNamesnativeSQLpingInternalprepareCallprepareCallprepareCallprepareStatementprepareStatementprepareStatementprepareStatementprepareStatementprepareStatementrecachePreparedStatementregisterStatementreleaseSavepointresetServerStaterollbackrollbackserverPrepareStatementserverPrepareStatementserverPrepareStatementserverPrepareStatementserverPrepareStatementserverPrepareStatementsetAutoCommitsetCatalogsetClientInfosetClientInfosetDatabasesetFailedOversetHoldabilitysetInGlobalTxsetNetworkTimeoutsetProxysetReadOnlysetReadOnlyInternalsetSavepointsetSavepointsetSchemasetSessionMaxRowssetStatementCommentsetTransactionIsolationsetTypeMapshutdownServerstoresLowerCaseTableNamethrowConnectionClosedExceptiontransactionBeguntransactionCompletedunregisterStatementunSafeQueryInterceptors

Constructor Detail

LoadBalancedMySQLConnectionback to summary
public LoadBalancedMySQLConnection(LoadBalancedConnectionProxy proxy)

Method Detail

addHostback to summary
public boolean addHost(String host) throws SQLException

Implements com.mysql.cj.jdbc.ha.LoadBalancedConnection.addHost.

Annotations
@Override
closeback to summary
public void close() throws SQLException

Overrides com.mysql.cj.jdbc.ha.MultiHostMySQLConnection.close.

Implements java.sql.Connection.close.

Doc from java.sql.Connection.close.

Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.

Calling the method close on a Connection object that is already closed is a no-op.

It is strongly recommended that an application explicitly commits or rolls back an active transaction prior to calling the close method. If the close method is called and there is an active transaction, the results are implementation-defined.

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
getThisAsProxyback to summary
public LoadBalancedConnectionProxy getThisAsProxy()

Overrides com.mysql.cj.jdbc.ha.MultiHostMySQLConnection.getThisAsProxy.

Annotations
@Override
isWrapperForback to summary
public boolean isWrapperFor(Class<?> iface) throws SQLException

Overrides com.mysql.cj.jdbc.ha.MultiHostMySQLConnection.isWrapperFor.

Implements java.sql.Wrapper.isWrapperFor.

Doc from java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.

Parameters
iface:Class<?>

a Class defining an interface.

Returns:boolean

true if this implements the interface or directly or indirectly wraps an object that does.

Annotations
@Override
Exceptions
SQLException:
if an error occurs while determining whether this is a wrapper for an object with the given interface.
pingback to summary
public void ping() throws SQLException

Overrides com.mysql.cj.jdbc.ha.MultiHostMySQLConnection.ping.

Implements com.mysql.cj.jdbc.JdbcConnection.ping.

Doc from com.mysql.cj.jdbc.JdbcConnection.ping.

Detect if the connection is still good by sending a ping command to the server.

Annotations
@Override
Exceptions
SQLException:
if the ping fails
pingback to summary
public void ping(boolean allConnections) throws SQLException

Implements com.mysql.cj.jdbc.ha.LoadBalancedConnection.ping.

Annotations
@Override
removeHostback to summary
public void removeHost(String host) throws SQLException

Implements com.mysql.cj.jdbc.ha.LoadBalancedConnection.removeHost.

Annotations
@Override
removeHostWhenNotInUseback to summary
public void removeHostWhenNotInUse(String host) throws SQLException

Implements com.mysql.cj.jdbc.ha.LoadBalancedConnection.removeHostWhenNotInUse.

Annotations
@Override
unwrapback to summary
public <T> T unwrap(Class<T> iface) throws SQLException

Overrides com.mysql.cj.jdbc.ha.MultiHostMySQLConnection.unwrap.

Implements java.sql.Wrapper.unwrap.

Doc from java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling unwrap recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an SQLException is thrown.

Parameters
<T>
the type of the class modeled by this Class object
iface:Class<T>

A Class defining an interface that the result must implement.

Returns:T

an object that implements the interface. May be a proxy for the actual implementing object.

Annotations
@Override
Exceptions
SQLException:
If no object found that implements the interface