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

public Class StandardLoadBalanceExceptionChecker

extends Object
implements LoadBalanceExceptionChecker
Class Inheritance
All Implemented Interfaces
com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker
Known Direct Subclasses
com.mysql.cj.jdbc.ha.NdbLoadBalanceExceptionChecker
Imports
java.sql.SQLException, java.util.Iterator, .List, .Objects, .Properties, java.util.stream.Collectors, com.mysql.cj.conf.PropertyKey, com.mysql.cj.exceptions.CJCommunicationsException, com.mysql.cj.jdbc.exceptions.CommunicationsException, com.mysql.cj.util.StringUtils

Field Summary

Modifier and TypeField and Description
private List<Class<?>>
private List<String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
public void
destroy()

Implements com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker.destroy.

Called by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.

public void
init(Properties
configuration values as passed to the connection. Note that in order to support javax.sql.DataSources, configuration properties specific to an interceptor must be passed via setURL() on the DataSource. Extension properties are not exposed via accessor/mutator methods on DataSources.
props
)

Implements com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker.init.

Called once per connection that wants to use the extension The properties are the same ones passed in in the URL or arguments to Driver.connect() or DriverManager.getConnection().

public boolean
shouldExceptionTriggerFailover(Throwable
exception
ex
)

Implements com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker.shouldExceptionTriggerFailover.

Invoked to determine whether or a given SQLException should trigger a failover in a load-balanced deployment.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sqlExClassListback to summary
private List<Class<?>> sqlExClassList
sqlStateListback to summary
private List<String> sqlStateList

Constructor Detail

StandardLoadBalanceExceptionCheckerback to summary
public StandardLoadBalanceExceptionChecker()

Method Detail

configureSQLExceptionSubclassListback to summary
private void configureSQLExceptionSubclassList(String sqlExClasses)
configureSQLStateListback to summary
private void configureSQLStateList(String sqlStates)
destroyback to summary
public void destroy()

Implements com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker.destroy.

Doc from com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker.destroy.

Called by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.

Annotations
@Override
initback to summary
public void init(Properties props)

Implements com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker.init.

Doc from com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker.init.

Called once per connection that wants to use the extension The properties are the same ones passed in in the URL or arguments to Driver.connect() or DriverManager.getConnection().

Parameters
props:Properties

configuration values as passed to the connection. Note that in order to support javax.sql.DataSources, configuration properties specific to an interceptor must be passed via setURL() on the DataSource. Extension properties are not exposed via accessor/mutator methods on DataSources.

Annotations
@Override
shouldExceptionTriggerFailoverback to summary
public boolean shouldExceptionTriggerFailover(Throwable ex)

Implements com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker.shouldExceptionTriggerFailover.

Doc from com.mysql.cj.jdbc.ha.LoadBalanceExceptionChecker.shouldExceptionTriggerFailover.

Invoked to determine whether or a given SQLException should trigger a failover in a load-balanced deployment. The driver will not pass in a Connection instance when calling init(), but it will pass in the Properties, otherwise it acts like a normal Extension. One instance of a handler *per* JDBC connection instance will be created. If you need singleton-like behavior, you're on your own to provide it.

Parameters
ex:Throwable

exception

Returns:boolean

true if the exception should trigger failover.

Annotations
@Override