- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.sql.SQLException
-
- java.sql.SQLRecoverableException
-
- All Implemented Interfaces:
-
Serializable,Iterable<Throwable>
public class SQLRecoverableException extends SQLException
如果应用程序执行某些恢复步骤并重试整个事务,或者在分布式事务(即事务分支)的情况下,先前发生故障的操作可能会成功的子类抛出SQLException。 至少,恢复操作必须包括关闭当前连接并获取新的连接。- 从以下版本开始:
- 1.6
- 另请参见:
- Serialized Form
-
-
构造方法摘要
构造方法 Constructor 描述 SQLRecoverableException()构造一个SQLRecoverableException对象。SQLRecoverableException(String reason)构造一个SQLRecoverableException对象与给定的reason。SQLRecoverableException(String reason, String SQLState)构造一个SQLRecoverableException对象,给定的reason和SQLState。SQLRecoverableException(String reason, String SQLState, int vendorCode)构造一个SQLRecoverableException与给定对象reason,SQLState和vendorCode。SQLRecoverableException(String reason, String SQLState, int vendorCode, Throwable cause)构造一个SQLRecoverableException与给定对象reason,SQLState,vendorCode和cause。SQLRecoverableException(String reason, String SQLState, Throwable cause)构造一个SQLRecoverableException与给定对象reason,SQLState和cause。SQLRecoverableException(String reason, Throwable cause)使用给定的reason和cause构造一个SQLRecoverableException对象。SQLRecoverableException(Throwable cause)构造一个SQLRecoverableException对象与给定的cause。
-
方法摘要
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, iterator, setNextException
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
构造方法详细信息
-
SQLRecoverableException
public SQLRecoverableException()
构造一个SQLRecoverableException对象。 的reason,SQLState被初始化为null和供应商代码被初始化为0。cause没有初始化,随后可以通过向一个呼叫进行初始化Throwable.initCause(java.lang.Throwable)方法。- 从以下版本开始:
- 1.6
-
SQLRecoverableException
public SQLRecoverableException(String reason)
构造一个SQLRecoverableException对象与给定的reason。SQLState初始化为null,供应商代码初始化为0.cause未初始化,可以随后通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。- 参数
-
reason- 异常的描述 - 从以下版本开始:
- 1.6
-
SQLRecoverableException
public SQLRecoverableException(String reason, String SQLState)
使用给定的reason和SQLState构造一个SQLRecoverableException对象。cause未初始化,可以通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。 供应商代码初始化为0。- 参数
-
reason- 异常的描述 -
SQLState- 标识异常的XOPEN或SQL:2003代码 - 从以下版本开始:
- 1.6
-
SQLRecoverableException
public SQLRecoverableException(String reason, String SQLState, int vendorCode)
构造一个SQLRecoverableException与给定对象reason,SQLState和vendorCode。cause未初始化,可以随后通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。- 参数
-
reason- 异常的描述 -
SQLState- 标识异常的XOPEN或SQL:2003代码 -
vendorCode- 数据库供应商特定的异常代码 - 从以下版本开始:
- 1.6
-
SQLRecoverableException
public SQLRecoverableException(Throwable cause)
构造一个SQLRecoverableException对象与给定的cause。 该SQLState被初始化为null和供应商代码被初始化为0。reason被初始化为null如果cause==null或cause.toString()如果cause!=null。- 参数
-
cause-底层原因SQLException(保存用于由稍后检索getCause()方法); 可能为空,表示原因不存在或未知。 - 从以下版本开始:
- 1.6
-
SQLRecoverableException
public SQLRecoverableException(String reason, Throwable cause)
构造一个SQLRecoverableException对象与一个给定的reason和cause。SQLState被初始化为null,供应商代码被初始化为0。- 参数
-
reason- 异常的描述。 -
cause-SQLException(其保存以供getCause()方法稍后检索)的根本原因; 可能为空,表示原因不存在或未知。 - 从以下版本开始:
- 1.6
-
SQLRecoverableException
public SQLRecoverableException(String reason, String SQLState, Throwable cause)
构造一个SQLRecoverableException与给定对象reason,SQLState和cause。 供应商代码初始化为0。- 参数
-
reason- 异常的描述。 -
SQLState- 标识异常的XOPEN或SQL:2003代码 -
cause- 这个SQLException的基本原因(其保存以供getCause()方法稍后检索); 可能为空,表示原因不存在或未知。 - 从以下版本开始:
- 1.6
-
SQLRecoverableException
public SQLRecoverableException(String reason, String SQLState, int vendorCode, Throwable cause)
构造一个SQLRecoverableException与给定对象reason,SQLState,vendorCode和cause。- 参数
-
reason- 异常的描述 -
SQLState- 标识异常的XOPEN或SQL:2003代码 -
vendorCode- 数据库供应商特定的异常代码 -
cause-底层原因SQLException(保存用于由稍后检索getCause()方法); 可能为空,表示原因不存在或未知。 - 从以下版本开始:
- 1.6
-
-