Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.
Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
java.sql
Class SQLWarning
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--java.sql.SQLException
|
+--java.sql.SQLWarning
- All Implemented Interfaces:
- java.io.Serializable
- 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.
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()
,
Statement.getWarnings()
,
ResultSet.getWarnings()
, Serialized Form
Constructor Summary |
SQLWarning()
Constructs a default SQLWarning object. |
SQLWarning(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(java.lang.String reason,
java.lang.String SQLstate)
Constructs an SQLWarning object
with the given reason and SQLState;
the vendorCode defaults to 0. |
SQLWarning(java.lang.String reason,
java.lang.String SQLstate,
int vendorCode)
Constructs a fully-specified SQLWarning object
initialized with the given values. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SQLWarning
public SQLWarning(java.lang.String reason,
java.lang.String SQLstate,
int vendorCode)
- Constructs a fully-specified
SQLWarning
object
initialized with the given values.
- Parameters:
reason
- a description of the warningSQLstate
- an XOPEN code identifying the warningvendorCode
- a database vendor-specific warning code
SQLWarning
public SQLWarning(java.lang.String reason,
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 warningSQLstate
- an XOPEN code identifying the warning
SQLWarning
public SQLWarning(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
public SQLWarning()
- Constructs a default
SQLWarning
object.
The reason defaults to null
, SQLState
defaults to null
, and vendorCode defaults to 0.
getNextWarning
public 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)
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- See Also:
getNextWarning()
toString
public java.lang.String toString()
- Output the details of this
SQLWarning
- Overrides:
toString
in class SQLException
- Returns:
- the
SQLWarning
contents
Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.
For more information, please consult the JSR 169 specification.