public class SQLWarning
extends SQLException
| java.lang.Object | ||||
| java.lang.Throwable | ||||
| java.lang.Exception | ||||
| java.sql.SQLException | ||||
| java.sql.SQLWarning | ||||
| |
提供有关数据库访问警告信息的例外。 警告被无声地链接到其方法导致其被报告的对象。
警告可以从被检索Connection , Statement ,和ResultSet对象。 尝试在连接关闭后检索警告会导致引发异常。 同样,试图在语句关闭后或语句关闭后的结果集上检索警告将导致引发异常。 请注意,关闭语句也会关闭它可能产生的结果集。
Public constructors |
|
|---|---|
SQLWarning(String reason, String SQLState, int vendorCode) 构造一个 |
|
SQLWarning(String reason, String SQLState) 用给定的 |
|
SQLWarning(String reason) 用给定的 |
|
SQLWarning() 构造一个 |
|
SQLWarning(Throwable cause) 用给定的 |
|
SQLWarning(String reason, Throwable cause) 使用给定的 |
|
SQLWarning(String reason, String SQLState, Throwable cause) 构造一个 |
|
SQLWarning(String reason, String SQLState, int vendorCode, Throwable cause) 构造一个 |
|
公共方法(Public methods) |
|
|---|---|
SQLWarning |
getNextWarning() 通过 |
void |
setNextWarning(SQLWarning w) 将一个 |
继承方法(Inherited methods) |
|
|---|---|
java.sql.SQLException
|
|
java.lang.Throwable
|
|
java.lang.Object
|
|
java.lang.Iterable
|
|
SQLWarning (String reason, String SQLState, int vendorCode)
构造一个SQLWarning与给定对象reason , SQLState和vendorCode 。 cause未初始化,并可能随后通过调用initCause(java.lang.Throwable)方法进行初始化。
| 参数(Parameters) | |
|---|---|
reason |
String: a description of the warning |
SQLState |
String: an XOPEN or SQL:2003 code identifying the warning |
vendorCode |
int: a database vendor-specific warning code |
SQLWarning (String reason, String SQLState)
使用给定的reason和SQLState构造一个SQLWarning对象。 cause未初始化,并可能随后通过调用initCause(java.lang.Throwable)方法进行初始化。 供应商代码初始化为0。
| 参数(Parameters) | |
|---|---|
reason |
String: a description of the warning |
SQLState |
String: an XOPEN or SQL:2003 code identifying the warning |
SQLWarning (String reason)
用给定的reason构造一个SQLWarning对象。 SQLState初始化为null ,并将供应商代码初始化为0. cause未初始化,并可能随后通过调用initCause(java.lang.Throwable)方法进行初始化。
| 参数(Parameters) | |
|---|---|
reason |
String: a description of the warning |
SQLWarning ()
构造一个SQLWarning对象。 的reason , SQLState被初始化为null和供应商代码被初始化为0。 cause没有初始化,随后可以通过向一个呼叫进行初始化initCause(java.lang.Throwable)方法。
SQLWarning (Throwable cause)
用给定的cause构造一个SQLWarning对象。 SQLState初始化为null ,供应商代码初始化为0. reason初始化为null如果为cause==null或cause.toString()如果为null则初始化为cause!=null 。
| 参数(Parameters) | |
|---|---|
cause |
Throwable: the underlying reason for this SQLWarning (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown. |
SQLWarning (String reason, Throwable cause)
用给定的reason和cause构造一个SQLWarning对象。 SQLState初始化为null ,供应商代码初始化为0。
| 参数(Parameters) | |
|---|---|
reason |
String: a description of the warning |
cause |
Throwable: the underlying reason for this SQLWarning (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown. |
SQLWarning (String reason, String SQLState, Throwable cause)
构造一个SQLWarning与给定对象reason , SQLState和cause 。 供应商代码初始化为0。
| 参数(Parameters) | |
|---|---|
reason |
String: a description of the warning |
SQLState |
String: an XOPEN or SQL:2003 code identifying the warning |
cause |
Throwable: the underlying reason for this SQLWarning (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown. |
SQLWarning (String reason, String SQLState, int vendorCode, Throwable cause)
构造一个 SQLWarning与给定对象 reason , SQLState , vendorCode和 cause 。
| 参数(Parameters) | |
|---|---|
reason |
String: a description of the warning |
SQLState |
String: an XOPEN or SQL:2003 code identifying the warning |
vendorCode |
int: a database vendor-specific warning code |
cause |
Throwable: the underlying reason for this SQLWarning (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown. |
SQLWarning getNextWarning ()
通过 setNextWarning检索链接到此 SQLWarning对象的 setNextWarning 。
| 返回(Returns) | |
|---|---|
SQLWarning |
the next SQLException in the chain; null if none |
也可以看看:
void setNextWarning (SQLWarning w)
将 SQLWarning对象添加到链的末尾。
| 参数(Parameters) | |
|---|---|
w |
SQLWarning: the new end of the SQLException chain |
也可以看看: