public class SQLWarning extends SQLException
提供数据库访问警告的信息的异常。警告是无声的链接到对象的方法导致它被报告。
警告可能会从Connection
,Statement
检索,并ResultSet
对象。试图在已关闭后检索连接上的警告将导致引发异常。类似地,在关闭或关闭后的结果集上,试图检索一个语句的警告将导致被抛出的异常。请注意,关闭一个语句也关闭一个可能产生的结果集。
Constructor and Description |
---|
SQLWarning()
构建了一个
SQLWarning 对象。
|
SQLWarning(String reason)
构建一个与给定的
reason
SQLWarning 对象。
|
SQLWarning(String reason, String SQLState)
构建一个与给定的
reason 和
SQLState
SQLWarning 对象。
|
SQLWarning(String reason, String SQLState, int vendorCode)
构建了一个
SQLWarning 对象与一个给定的
reason ,
SQLState 和
vendorCode 。
|
SQLWarning(String reason, String SQLState, int vendorCode, Throwable cause)
构建一个与给定的
reason ,
SQLState
SQLWarning 对象,
vendorCode 和
cause 。
|
SQLWarning(String reason, String SQLState, Throwable cause)
构建了一个
SQLWarning 对象与一个给定的
reason ,
SQLState 和
cause 。
|
SQLWarning(String reason, Throwable cause)
构建一个与给定的
reason 和
cause
SQLWarning 对象。
|
SQLWarning(Throwable cause)
构建一个与给定的
cause
SQLWarning 对象。
|
Modifier and Type | Method and Description |
---|---|
SQLWarning |
getNextWarning()
在这
SQLWarning 检索预警对象
setNextWarning 。
|
void |
setNextWarning(SQLWarning w)
SQLWarning 对象添加到链的末尾。
|
getErrorCode, getNextException, getSQLState, iterator, setNextException
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public SQLWarning(String reason, String SQLState, int vendorCode)
SQLWarning
对象与一个给定的
reason
,
SQLState
和
vendorCode
。的
cause
没有初始化,并随后可被调用的方法的
Throwable.initCause(java.lang.Throwable)
初始化。
reason
-描述的警告
SQLState
- XOPEN或SQL:2003码识别的警告
vendorCode
-数据库供应商特定的报警代码
public SQLWarning(String reason, String SQLState)
reason
和
SQLState
SQLWarning
对象。的
cause
没有初始化,并随后可被调用的方法的
Throwable.initCause(java.lang.Throwable)
初始化。供应商代码被初始化为0。
reason
-描述的警告
SQLState
- XOPEN或SQL:2003码识别的警告
public SQLWarning(String reason)
reason
SQLWarning
对象,
SQLState
初始化为
null
和厂商代码初始化为0。的
cause
没有初始化,并随后可被调用的方法的
Throwable.initCause(java.lang.Throwable)
初始化。
reason
-描述的警告
public SQLWarning()
SQLWarning
对象。的
reason
,
SQLState
初始化为
null
和厂商代码初始化为0。的
cause
没有初始化,并随后可被调用的方法的
Throwable.initCause(java.lang.Throwable)
初始化。
public SQLWarning(Throwable cause)
cause
SQLWarning
对象。的
SQLState
初始化为
null
和厂商代码初始化为0。的
reason
初始化为
null
如果
cause==null
或
cause.toString()
如果
cause!=null
。
cause
-这
SQLWarning
的根本原因(这是以后的
getCause()
方法检索);可能是null指示的原因是不存在的或未知的。
public SQLWarning(String reason, Throwable cause)
reason
和
cause
SQLWarning
对象。的
SQLState
初始化为
null
和厂商代码初始化为0。
reason
-描述的警告
cause
-这
SQLWarning
的根本原因(这是以后的
getCause()
方法检索);可能是null指示的原因是不存在的或未知的。
public SQLWarning(String reason, String SQLState, Throwable cause)
SQLWarning
对象与一个给定的
reason
,
SQLState
和
cause
。供应商代码被初始化为0。
reason
-描述的警告
SQLState
- XOPEN或SQL:2003码识别的警告
cause
-这
SQLWarning
的根本原因(这是以后的
getCause()
方法检索);可能是null指示的原因是不存在的或未知的。
public SQLWarning getNextWarning()
SQLWarning
检索预警对象
setNextWarning
。
SQLException
;
null
如果没有
setNextWarning(java.sql.SQLWarning)
public void setNextWarning(SQLWarning w)
SQLWarning
对象添加到链的末尾。
w
的
SQLException
链的新的结束
getNextWarning()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.