Module java.sql.rowset
Package javax.sql.rowset

Class RowSetWarning

所有已实现的接口:
Serializable, Iterable<Throwable>

public class RowSetWarning extends SQLException
RowSetWarning的扩展,提供有关设置在RowSet对象上的数据库警告的信息。警告会被静默链接到调用导致其报告的对象上。该类补充了SQLWarning类。

可以从JdbcRowSetCachedRowSetWebRowSetFilteredRowSetJoinRowSet实现中检索Rowset警告。要检索在任何RowSet实现上报告的第一个警告,请使用JdbcRowSet接口或CachedRowSet接口中定义的getRowSetWarnings方法。要检索链接到第一个警告的警告,请使用RowSetWarning方法getNextWarning。要检索后续警告,请在返回的每个RowSetWarning对象上调用getNextWarning

继承的方法getMessagegetSQLStategetErrorCode检索包含在RowSetWarning对象中的信息。

自版本:
1.5
参见:
  • Constructor Details

    • RowSetWarning

      public RowSetWarning(String reason)
      使用给定的原因值构造一个RowSetWarning对象;SQLState默认为null,vendorCode默认为0。
      参数:
      reason - 一个描述警告的String对象;如果Stringnull,则此构造函数的行为类似于默认(零参数)RowSetWarning构造函数
    • RowSetWarning

      public RowSetWarning()
      构造一个默认的RowSetWarning对象。原因默认为null,SQLState默认为null,vendorCode默认为0。
    • RowSetWarning

      public RowSetWarning(String reason, String SQLState)
      使用给定的原因和SQLState值初始化一个RowSetWarning对象。供应商代码默认为0。如果reasonSQLState参数为null,则此构造函数的行为类似于默认(零参数)RowSetWarning构造函数。
      参数:
      reason - 描述警告的String
      SQLState - 识别警告的XOPEN代码;如果提供了非标准的XOPEN SQLState,则不会抛出异常。
    • RowSetWarning

      public RowSetWarning(String reason, String SQLState, int vendorCode)
      使用给定的原因、SQLState和vendorCode值初始化一个完全指定的RowSetWarning对象。如果reasonSQLState参数为null,则此构造函数的行为类似于默认(零参数)RowSetWarning构造函数。
      参数:
      reason - 描述警告的String
      SQLState - 识别警告的XOPEN代码;如果提供了非标准的XOPEN SQLState,则不会抛出异常。
      vendorCode - 数据库供应商特定的警告代码
  • Method Details

    • getNextWarning

      public RowSetWarning getNextWarning()
      检索链接到此RowSetWarning对象的警告。
      返回:
      链接到此对象的RowSetWarning对象;如果没有RowSetWarning对象链接到此对象,则返回null(默认值)
      参见:
    • setNextWarning

      public void setNextWarning(RowSetWarning warning)
      warning设置为下一个警告,即链接到此RowSetWarning对象的警告。
      参数:
      warning - 要设置为下一个警告的RowSetWarning对象;如果RowSetWarning为null,则表示警告链中的结束点
      参见: