An exception that provides information on a database access error or other errors.
Each SQLException provides several kinds of information:
getMessage.
DatabaseMetaData method getSQLStateType
can be used to discover whether the driver returns the XOPEN type or
the SQL:2003 type.
SQLException.
| Modifier and Type | Field and Description |
|---|---|
| private volatile SQLException | |
| private static final AtomicReferenceFieldUpdater | |
| private static final long | |
| private String | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | SQLException(String
a description of the exception reason, String an XOPEN or SQL:2003 code identifying the exception SQLState, int a database vendor-specific exception code vendorCode)Constructs a |
| public | SQLException(String
a description of the exception reason, String an XOPEN or SQL:2003 code identifying the exception SQLState)Constructs a |
| public | SQLException(String
a description of the exception reason)Constructs a |
| public | |
| public | SQLException(Throwable
the underlying reason for this cause)SQLException
(which is saved for later retrieval by the getCause() method);
may be null indicating the cause is non-existent or unknown.Constructs a |
| public | SQLException(String
a description of the exception. reason, Throwable the underlying reason for this cause)SQLException
(which is saved for later retrieval by the getCause() method);
may be null indicating the cause is non-existent or unknown.Constructs a |
| public | SQLException(String
a description of the exception. reason, String an XOPEN or SQL:2003 code identifying the exception sqlState, Throwable the underlying reason for this cause)SQLException
(which is saved for later retrieval by the
getCause() method); may be null indicating
the cause is non-existent or unknown.Constructs a |
| public | SQLException(String
a description of the exception reason, String an XOPEN or SQL:2003 code identifying the exception sqlState, int a database vendor-specific exception code vendorCode, Throwable the underlying reason for this cause)SQLException
(which is saved for later retrieval by the getCause() method);
may be null indicating the cause is non-existent or unknown.Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the vendor's error codeRetrieves the vendor-specific exception code
for this |
| public SQLException | Returns: the nextSQLException object in the chain;
null if there are noneRetrieves the exception chained to this
|
| public String | |
| public Iterator | Returns: an iterator over the chained SQLExceptions and causes in the proper orderImplements java. Returns an iterator over the chained SQLExceptions. |
| public void | setNextException(SQLException
the new exception that will be added to the end of
the ex)SQLException chainAdds an |
| next | back to summary |
|---|---|
| private volatile SQLException next | |
| nextUpdater | back to summary |
|---|---|
| private static final AtomicReferenceFieldUpdater<SQLException, SQLException> nextUpdater | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| SQLState | back to summary |
|---|---|
| private String SQLState | |
| vendorCode | back to summary |
|---|---|
| private int vendorCode | |
| SQLException | back to summary |
|---|---|
| public SQLException(String reason, String SQLState, int vendorCode) Constructs a | |
| SQLException | back to summary |
|---|---|
| public SQLException(String reason, String SQLState) Constructs a | |
| SQLException | back to summary |
|---|---|
| public SQLException(String reason) Constructs a
| |
| SQLException | back to summary |
|---|---|
| public SQLException() Constructs a | |
| SQLException | back to summary |
|---|---|
| public SQLException(Throwable cause) Constructs a
| |
| SQLException | back to summary |
|---|---|
| public SQLException(String reason, Throwable cause) Constructs a | |
| SQLException | back to summary |
|---|---|
| public SQLException(String reason, String sqlState, Throwable cause) Constructs a
| |
| SQLException | back to summary |
|---|---|
| public SQLException(String reason, String sqlState, int vendorCode, Throwable cause) Constructs a
| |
| getErrorCode | back to summary |
|---|---|
| public int getErrorCode() Retrieves the vendor-specific exception code
for this
| |
| getNextException | back to summary |
|---|---|
| public SQLException getNextException() Retrieves the exception chained to this
| |
| getSQLState | back to summary |
|---|---|
| public String getSQLState() Retrieves the SQLState for this
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Returns an iterator over the chained SQLExceptions. The iterator will be used to iterate over each SQLException and its underlying cause (if any). | |
| setNextException | back to summary |
|---|---|
| public void setNextException(SQLException ex) Adds an
| |