public class SQLWarning extends SQLException
提供有关数据库访问警告的信息的异常。 警告被静默链接到方法导致其报告的对象。
 警告可以从被检索Connection , Statement和ResultSet对象。 尝试在连接关闭之后检索警告将导致抛出异常。 类似地,尝试在关闭语句或在结果集关闭后在语句上检索警告将导致抛出异常。 请注意,关闭语句也会关闭它可能产生的结果集。 
| Constructor and Description | 
|---|
SQLWarning() 
            
              构造一个 
               SQLWarning对象。 
             |  
          
SQLWarning(String reason) 
            
              构造一个 
               SQLWarning对象与给定的 
             reason 。 
             |  
          
SQLWarning(String reason, String SQLState) 
            
              构造一个 
               SQLWarning对象与给定的 
             reason和 
             SQLState 。 
             |  
          
SQLWarning(String reason, String SQLState, int vendorCode) 
            
              构造一个 
               SQLWarning与给定对象 
             reason , 
             SQLState和 
             vendorCode 。 
             |  
          
SQLWarning(String reason, String SQLState, int vendorCode, Throwable cause) 
            
              构造一个 
               SQLWarning与给定对象 
             reason , 
             SQLState , 
             vendorCode和 
             cause 。 
             |  
          
SQLWarning(String reason, String SQLState, Throwable cause) 
            
              构造一个 
               SQLWarning与给定对象 
             reason , 
             SQLState和 
             cause 。 
             |  
          
SQLWarning(String reason, Throwable cause) 
            
              构造一个 
               SQLWarning对象与给定的 
             reason和 
             cause 。 
             |  
          
SQLWarning(Throwable cause) 
            
              构造一个 
               SQLWarning对象与给定的 
             cause 。 
             |  
          
| Modifier and Type | Method and Description | 
|---|---|
SQLWarning |  
           getNextWarning() 
            
              检索 
               SQLWarning对象由 
             setNextWarning链接的警告。 
             |  
          
void |  
           setNextWarning(SQLWarning w) 
            
              将 
               SQLWarning对象添加到链的末尾。 
             |  
          
getErrorCode, getNextException, getSQLState, iterator, setNextExceptionaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic 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)
SQLWarning对象与给定的reason 。 
           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)
SQLWarning对象与给定的cause 。 
           该SQLState被初始化为null ,供应商代码被初始化为0。 reason被初始化为null如果cause==null ,或cause.toString()如果cause!=null 。 
            
          cause -底层原因SQLWarning (保存用于由稍后检索getCause()方法); 
            可能为空,表示原因不存在或未知。 
           public SQLWarning(String reason, Throwable cause)
SQLWarning对象与给定的reason和cause 。 
           SQLState初始化为null ,供应商代码初始化为0。 
            
          reason - 警告的说明 
           cause -底层原因SQLWarning (保存用于由稍后检索getCause()方法); 
            可能为空,表示原因不存在或未知。 
           public SQLWarning(String reason, String SQLState, Throwable cause)
SQLWarning与给定对象reason , SQLState和cause 。 
           供应商代码初始化为0。 
            
          reason - 警告的说明 
           SQLState - 标识警告的XOPEN或SQL:2003代码 
           cause -底层原因SQLWarning (保存用于由稍后检索getCause()方法); 
            可能为空,表示原因不存在或未知。 
           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.