java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
javax.sql.rowset.RowSetWarning
- 所有已实现的接口:
-
Serializable,Iterable<Throwable>
RowSetWarning的扩展,提供有关设置在RowSet对象上的数据库警告的信息。警告会被静默链接到调用导致其报告的对象上。该类补充了SQLWarning类。
可以从JdbcRowSet、CachedRowSet、WebRowSet、FilteredRowSet或JoinRowSet实现中检索Rowset警告。要检索在任何RowSet实现上报告的第一个警告,请使用JdbcRowSet接口或CachedRowSet接口中定义的getRowSetWarnings方法。要检索链接到第一个警告的警告,请使用RowSetWarning方法getNextWarning。要检索后续警告,请在返回的每个RowSetWarning对象上调用getNextWarning。
继承的方法getMessage、getSQLState和getErrorCode检索包含在RowSetWarning对象中的信息。
- 自版本:
- 1.5
- 参见:
-
Constructor Summary
ConstructorsConstructorDescription构造一个默认的RowSetWarning对象。RowSetWarning(String reason) 使用给定的原因值构造一个RowSetWarning对象;SQLState默认为null,vendorCode默认为0。RowSetWarning(String reason, String SQLState) 使用给定的原因和SQLState值初始化一个RowSetWarning对象。RowSetWarning(String reason, String SQLState, int vendorCode) 使用给定的原因、SQLState和vendorCode值初始化一个完全指定的RowSetWarning对象。 -
Method Summary
Modifier and TypeMethodDescription检索链接到此RowSetWarning对象的警告。voidsetNextWarning(RowSetWarning warning) 将warning设置为下一个警告,即链接到此RowSetWarning对象的警告。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
-
RowSetWarning
使用给定的原因值构造一个RowSetWarning对象;SQLState默认为null,vendorCode默认为0。- 参数:
-
reason- 一个描述警告的String对象;如果String为null,则此构造函数的行为类似于默认(零参数)RowSetWarning构造函数
-
RowSetWarning
public RowSetWarning()构造一个默认的RowSetWarning对象。原因默认为null,SQLState默认为null,vendorCode默认为0。 -
RowSetWarning
使用给定的原因和SQLState值初始化一个RowSetWarning对象。供应商代码默认为0。如果reason或SQLState参数为null,则此构造函数的行为类似于默认(零参数)RowSetWarning构造函数。- 参数:
-
reason- 描述警告的String; -
SQLState- 识别警告的XOPEN代码;如果提供了非标准的XOPEN SQLState,则不会抛出异常。
-
RowSetWarning
使用给定的原因、SQLState和vendorCode值初始化一个完全指定的RowSetWarning对象。如果reason或SQLState参数为null,则此构造函数的行为类似于默认(零参数)RowSetWarning构造函数。- 参数:
-
reason- 描述警告的String; -
SQLState- 识别警告的XOPEN代码;如果提供了非标准的XOPEN SQLState,则不会抛出异常。 -
vendorCode- 数据库供应商特定的警告代码
-
-
Method Details
-
getNextWarning
检索链接到此RowSetWarning对象的警告。- 返回:
-
链接到此对象的
RowSetWarning对象;如果没有RowSetWarning对象链接到此对象,则返回null(默认值) - 参见:
-
setNextWarning
将warning设置为下一个警告,即链接到此RowSetWarning对象的警告。- 参数:
-
warning- 要设置为下一个警告的RowSetWarning对象;如果RowSetWarning为null,则表示警告链中的结束点 - 参见:
-