类 StandardLoadBalanceExceptionChecker
- java.lang.Object
-
- com.mysql.cj.jdbc.ha.StandardLoadBalanceExceptionChecker
-
- 所有已实现的接口:
LoadBalanceExceptionChecker
- 直接已知子类:
NdbLoadBalanceExceptionChecker
public class StandardLoadBalanceExceptionChecker extends Object implements LoadBalanceExceptionChecker
-
-
构造器概要
构造器 构造器 说明 StandardLoadBalanceExceptionChecker()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddestroy()Called by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.voidinit(Properties props)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().booleanshouldExceptionTriggerFailover(Throwable ex)Invoked to determine whether or a given SQLException should trigger a failover in a load-balanced deployment.
-
-
-
方法详细资料
-
shouldExceptionTriggerFailover
public boolean shouldExceptionTriggerFailover(Throwable ex)
从接口复制的说明:LoadBalanceExceptionCheckerInvoked 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.- 指定者:
shouldExceptionTriggerFailover在接口中LoadBalanceExceptionChecker- 参数:
ex- exception- 返回:
- true if the exception should trigger failover.
-
destroy
public void destroy()
从接口复制的说明:LoadBalanceExceptionCheckerCalled by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.- 指定者:
destroy在接口中LoadBalanceExceptionChecker
-
init
public void init(Properties props)
从接口复制的说明:LoadBalanceExceptionCheckerCalled 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().- 指定者:
init在接口中LoadBalanceExceptionChecker- 参数:
props- 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.
-
-