Package java.sql
Class SQLWarning
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
java.sql.SQLWarning
- All Implemented Interfaces:
Serializable,Iterable<Throwable>
- Direct Known Subclasses:
DataTruncation
public class SQLWarning extends SQLException implements Serializable
An exception class that holds information about Database access warnings.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description SQLWarning()Creates anSQLWarningobject.SQLWarning(String theReason)Creates anSQLWarningobject.SQLWarning(String theReason, String theSQLState)Creates anSQLWarningobject.SQLWarning(String theReason, String theSQLState, int theErrorCode)Creates anSQLWarningobject.SQLWarning(String reason, String SQLState, int vendorCode, Throwable cause)Creates an SQLWarning object.SQLWarning(String reason, String SQLState, Throwable cause)Creates an SQLWarning object.SQLWarning(String reason, Throwable cause)Creates an SQLWarning object.SQLWarning(Throwable cause)Creates an SQLWarning object. -
Method Summary
Modifier and Type Method Description SQLWarninggetNextWarning()Gets the nextSQLWarningchained to thisSQLWarningobject.voidsetNextWarning(SQLWarning w)Chains a suppliedSQLWarningto thisSQLWarning.Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, iterator, setNextExceptionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SQLWarning
public SQLWarning()Creates anSQLWarningobject. The reason string is set tonull, theSQLStatestring is set tonulland the error code is set to 0. -
SQLWarning
Creates anSQLWarningobject. The reason string is set to the given reason string, theSQLStatestring is set tonulland the error code is set to 0.- Parameters:
theReason- the reason why this warning is issued.
-
SQLWarning
Creates anSQLWarningobject. The reason string is set to the given reason string, theSQLStatestring is set to the givenSQLStatestring and the error code is set to 0.- Parameters:
theReason- the reason why this warning is issued.theSQLState- the string to use as theSQLStatestring.
-
SQLWarning
Creates anSQLWarningobject. The reason string is set to the given reason string, theSQLStatestring is set to the givenSQLStatestring and the error code is set to the given error code value.- Parameters:
theReason- the reason why this warning is issued.theSQLState- the X/Open standard specifc error code.theErrorCode- a vendor specific error code.
-
SQLWarning
Creates an SQLWarning object. The Reason string is set to null, the SQLState string is set to null and the Error Code is set to 0, cause is set to cause.- Since:
- 1.6
-
SQLWarning
Creates an SQLWarning object. The Reason string is set to reason, the SQLState string is set to null and the Error Code is set to 0, cause is set to the given cause- Since:
- 1.6
-
SQLWarning
Creates an SQLWarning object. The Reason string is set to reason, the SQLState string is set to given SQLState and the Error Code is set to 0, cause is set to the given cause- Since:
- 1.6
-
SQLWarning
Creates an SQLWarning object. The Reason string is set to reason, the SQLState string is set to given SQLState and the Error Code is set to vendorCode, cause is set to the given cause- Since:
- 1.6
-
-
Method Details
-
getNextWarning
Gets the nextSQLWarningchained to thisSQLWarningobject.- Returns:
- the
SQLWarningchained to thisSQLWarning.nullif noSQLWarningis chained to thisSQLWarning.
-
setNextWarning
Chains a suppliedSQLWarningto thisSQLWarning.- Parameters:
w- theSQLWarninglinked to thisSQLWarning.
-