站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

Java(TM) 2 Platform, Standard Edition, v1.2.2 API Specification: Class SQLWarning - JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

JavaTM 2 Platform
Standard Edition

java.sql
Class SQLWarning

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.sql.SQLException
                    |
                    +--java.sql.SQLWarning
Direct Known Subclasses:
DataTruncation

public class SQLWarning
extends SQLException

An exception that provides information on database access warnings. Warnings are silently chained to the object whose method caused it to be reported.

See Also:
Connection.getWarnings(), Statement.getWarnings(), ResultSet.getWarnings(), Serialized Form

Constructor Summary
SQLWarning()
          Constructs a default SQLWarning object.
SQLWarning(String reason)
          Constructs an SQLWarning object with the given value for a reason; SQLState defaults to null, and vendorCode defaults to 0.
SQLWarning(String reason, String SQLstate)
          Constructs an SQLWarning object with the given reason and SQLState; the vendorCode defaults to 0.
SQLWarning(String reason, String SQLstate, int vendorCode)
          Constructs a fully-specified SQLWarning object initialized with the given values.
 
Method Summary
 SQLWarning getNextWarning()
          Retrieves the warning chained to this SQLWarning object.
 void setNextWarning(SQLWarning w)
          Adds an SQLWarning object to the end of the chain.
 
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, setNextException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLWarning

public SQLWarning(String reason,
                  String SQLstate,
                  int vendorCode)
Constructs a fully-specified SQLWarning object initialized with the given values.
Parameters:
reason - a description of the warning
SQLState - an XOPEN code identifying the warning
vendorCode - a database vendor-specific warning code

SQLWarning

public SQLWarning(String reason,
                  String SQLstate)
Constructs an SQLWarning object with the given reason and SQLState; the vendorCode defaults to 0.
Parameters:
reason - a description of the warning
SQLState - an XOPEN code identifying the warning

SQLWarning

public SQLWarning(String reason)
Constructs an SQLWarning object with the given value for a reason; SQLState defaults to null, and vendorCode defaults to 0.
Parameters:
reason - a description of the warning

SQLWarning

public SQLWarning()
Constructs a default SQLWarning object. The reason defaults to null, SQLState defaults to null, and vendorCode defaults to 0.
Method Detail

getNextWarning

public SQLWarning getNextWarning()
Retrieves the warning chained to this SQLWarning object.
Returns:
the next SQLException in the chain, null if none

setNextWarning

public void setNextWarning(SQLWarning w)
Adds an SQLWarning object to the end of the chain.
Parameters:
w - the new end of the SQLException chain

JavaTM 2 Platform
Standard Edition

Submit a bug or feature
Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.