java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
java.sql.SQLTransientException
java.sql.SQLTimeoutException
- 所有已实现的接口:
-
Serializable,Iterable<Throwable>
当由Statement.setQueryTimeout、DriverManager.setLoginTimeout、DataSource.setLoginTimeout、XADataSource.setLoginTimeout指定的超时已过期时抛出的SQLException子类。
此异常不对应标准的SQLState。
- 自从:
- 1.6
- 参见:
-
Constructor Summary
ConstructorsConstructorDescription构造一个SQLTimeoutException对象。SQLTimeoutException(String reason) 构造一个带有给定reason的SQLTimeoutException对象。SQLTimeoutException(String reason, String SQLState) 构造一个带有给定reason和SQLState的SQLTimeoutException对象。SQLTimeoutException(String reason, String SQLState, int vendorCode) 构造一个带有给定reason、SQLState和vendorCode的SQLTimeoutException对象。SQLTimeoutException(String reason, String SQLState, int vendorCode, Throwable cause) 构造一个带有给定reason、SQLState、vendorCode和cause的SQLTimeoutException对象。SQLTimeoutException(String reason, String SQLState, Throwable cause) 构造一个带有给定reason、SQLState和cause的SQLTimeoutException对象。SQLTimeoutException(String reason, Throwable cause) 构造一个带有给定reason和cause的SQLTimeoutException对象。SQLTimeoutException(Throwable cause) 构造一个带有给定cause的SQLTimeoutException对象。 -
Method Summary
Methods declared in class java.sql.SQLException
getErrorCode, getNextException, getSQLState, iterator, setNextExceptionMethods declared in class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods declared in interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SQLTimeoutException
public SQLTimeoutException()构造一个SQLTimeoutException对象。reason、SQLState被初始化为null,vendor code被初始化为0。cause未初始化,可以随后通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。- 自从:
- 1.6
-
SQLTimeoutException
构造一个带有给定reason的SQLTimeoutException对象。SQLState被初始化为null,vendor code被初始化为0。cause未初始化,可以随后通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。- 参数:
-
reason- 异常的描述 - 自从:
- 1.6
-
SQLTimeoutException
构造一个带有给定reason和SQLState的SQLTimeoutException对象。cause未初始化,可以随后通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。 vendor code被初始化为0。- 参数:
-
reason- 异常的描述 -
SQLState- 用于标识异常的XOPEN或SQL:2003代码 - 自从:
- 1.6
-
SQLTimeoutException
构造一个带有给定reason、SQLState和vendorCode的SQLTimeoutException对象。cause未初始化,可以随后通过调用Throwable.initCause(java.lang.Throwable)方法进行初始化。- 参数:
-
reason- 异常的描述 -
SQLState- 用于标识异常的XOPEN或SQL:2003代码 -
vendorCode- 数据库供应商特定的异常代码 - 自从:
- 1.6
-
SQLTimeoutException
构造一个带有给定cause的SQLTimeoutException对象。SQLState被初始化为null,vendor code被初始化为0。 如果cause==null,reason被初始化为null,如果cause!=null,reason被初始化为cause.toString()。- 参数:
-
cause- 此SQLException的根本原因(稍后可通过getCause()方法检索);可能为null,表示原因不存在或未知。 - 自从:
- 1.6
-
SQLTimeoutException
构造一个带有给定reason和cause的SQLTimeoutException对象。SQLState被初始化为null,vendor code被初始化为0。- 参数:
-
reason- 异常的描述。 -
cause- 此SQLException的根本原因(稍后可通过getCause()方法检索);可能为null,表示原因不存在或未知。 - 自从:
- 1.6
-
SQLTimeoutException
构造一个带有给定reason、SQLState和cause的SQLTimeoutException对象。 vendor code被初始化为0。- 参数:
-
reason- 异常的描述。 -
SQLState- 用于标识异常的XOPEN或SQL:2003代码 -
cause- 此SQLException的根本原因(稍后可通过getCause()方法检索);可能为null,表示原因不存在或未知。 - 自从:
- 1.6
-
SQLTimeoutException
构造一个带有给定reason、SQLState、vendorCode和cause的SQLTimeoutException对象。- 参数:
-
reason- 异常的描述 -
SQLState- 用于标识异常的XOPEN或SQL:2003代码 -
vendorCode- 数据库供应商特定的异常代码 -
cause- 此SQLException的根本原因(稍后可通过getCause()方法检索);可能为null,表示原因不存在或未知。 - 自从:
- 1.6
-