java.sql
Class SQLWarning

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.lang.Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable 
      extended by java.lang.Exception sample code for java.lang.Exception definition code for java.lang.Exception 
          extended by java.sql.SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException 
              extended by java.sql.SQLWarning
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable
Direct Known Subclasses:
DataTruncation sample code for java.sql.DataTruncation definition code for java.sql.DataTruncation

public class SQLWarning
extends SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException

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

Warnings may be retrieved from Connection, Statement, and ResultSet objects. Trying to retrieve a warning on a connection after it has been closed will cause an exception to be thrown. Similarly, trying to retrieve a warning on a statement after it has been closed or on a result set after it has been closed will cause an exception to be thrown. Note that closing a statement also closes a result set that it might have produced.

See Also:
Connection.getWarnings() sample code for java.sql.Connection.getWarnings() definition code for java.sql.Connection.getWarnings() , Statement.getWarnings() sample code for java.sql.Statement.getWarnings() definition code for java.sql.Statement.getWarnings() , ResultSet.getWarnings() sample code for java.sql.ResultSet.getWarnings() definition code for java.sql.ResultSet.getWarnings() , Serialized Form

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

Constructor Detail

SQLWarning sample code for java.sql.SQLWarning(java.lang.String, java.lang.String, int) definition code for java.sql.SQLWarning(java.lang.String, java.lang.String, int)

public SQLWarning(String sample code for java.lang.String definition code for java.lang.String  reason,
                  String sample code for java.lang.String definition code for java.lang.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 sample code for java.sql.SQLWarning(java.lang.String, java.lang.String) definition code for java.sql.SQLWarning(java.lang.String, java.lang.String)

public SQLWarning(String sample code for java.lang.String definition code for java.lang.String  reason,
                  String sample code for java.lang.String definition code for java.lang.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 sample code for java.sql.SQLWarning(java.lang.String) definition code for java.sql.SQLWarning(java.lang.String)

public SQLWarning(String sample code for java.lang.String definition code for java.lang.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 sample code for java.sql.SQLWarning() definition code for java.sql.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 sample code for java.sql.SQLWarning.getNextWarning() definition code for java.sql.SQLWarning.getNextWarning()

public SQLWarning sample code for java.sql.SQLWarning definition code for java.sql.SQLWarning  getNextWarning()
Retrieves the warning chained to this SQLWarning object.

Returns:
the next SQLException in the chain; null if none
See Also:
setNextWarning(java.sql.SQLWarning) sample code for java.sql.SQLWarning.setNextWarning(java.sql.SQLWarning) definition code for java.sql.SQLWarning.setNextWarning(java.sql.SQLWarning)

setNextWarning sample code for java.sql.SQLWarning.setNextWarning(java.sql.SQLWarning) definition code for java.sql.SQLWarning.setNextWarning(java.sql.SQLWarning)

public void setNextWarning(SQLWarning sample code for java.sql.SQLWarning definition code for java.sql.SQLWarning  w)
Adds an SQLWarning object to the end of the chain.

Parameters:
w - the new end of the SQLException chain
See Also:
getNextWarning() sample code for java.sql.SQLWarning.getNextWarning() definition code for java.sql.SQLWarning.getNextWarning()