| java.lang.Object java.lang.Throwable java.lang.Exception java.sql.SQLException
All known Subclasses: java.sql.SQLWarning, java.sql.BatchUpdateException,
SQLException | public class SQLException extends Exception implements Serializable(Code) | | An Exception class that is used in conjunction with JDBC operations. It
provides information about problems encountered with Database access and
other problems related to JDBC
The SQLException class provides the following information:
- A standard Java exception message, as a String
- An SQLState string. This is an error description string which follows
either the SQL 99 conventions or the XOPEN SQLstate conventions. The
potential values of the SQLState string are described in each of the
specifications. Which of the conventions is being used by the SQLState string
can be discovered by using the getSQLStateType method of the DatabaseMetaData
interface.
- An Error Code, an an integer. The error code is specific to each
database vendor and is typically the error code returned by the database
itself.
- A chain to a next Exception, if relevant, which can give access to
additional error information.
|
Method Summary | |
public int | getErrorCode() Returns the integer error code for this SQLException
The integer error code for this SQLException. | public SQLException | getNextException() Retrieves the SQLException chained to this SQLException, if any.
The SQLException chained to this SQLException. | public String | getSQLState() Retrieves the SQLState description string for this SQLException object
The SQLState string for this SQLException object. | public void | setNextException(SQLException ex) Adds the SQLException to the end of this SQLException chain. |
SQLException | public SQLException()(Code) | | Creates an SQLException object. The Reason string is set to null, the
SQLState string is set to null and the Error Code is set to 0.
|
SQLException | public SQLException(String theReason)(Code) | | Creates an SQLException object. The Reason string is set to the given
reason string, the SQLState string is set to null and the Error Code is
set to 0.
Parameters: theReason - the string to use as the Reason string |
SQLException | public SQLException(String theReason, String theSQLState)(Code) | | Creates an SQLException object. The Reason string is set to the given
reason string, the SQLState string is set to the given SQLState string
and the Error Code is set to 0.
Parameters: theReason - the string to use as the Reason string Parameters: theSQLState - the string to use as the SQLState string |
SQLException | public SQLException(String theReason, String theSQLState, int theErrorCode)(Code) | | Creates an SQLException object. The Reason string is set to the given
reason string, the SQLState string is set to the given SQLState string
and the Error Code is set to the given error code value.
Parameters: theReason - the string to use as the Reason string Parameters: theSQLState - the string to use as the SQLState string Parameters: theErrorCode - the integer value for the error code |
getErrorCode | public int getErrorCode()(Code) | | Returns the integer error code for this SQLException
The integer error code for this SQLException. The meaning of thecode is specific to the vendor of the database. |
getNextException | public SQLException getNextException()(Code) | | Retrieves the SQLException chained to this SQLException, if any.
The SQLException chained to this SQLException. null if there isno SQLException chained to this SQLException. |
getSQLState | public String getSQLState()(Code) | | Retrieves the SQLState description string for this SQLException object
The SQLState string for this SQLException object. This is anerror description string which follows either the SQL 99conventions or the XOPEN SQLstate conventions. The potentialvalues of the SQLState string are described in each of thespecifications. Which of the conventions is being used by theSQLState string can be discovered by using the getSQLStateTypemethod of the DatabaseMetaData interface. |
setNextException | public void setNextException(SQLException ex)(Code) | | Adds the SQLException to the end of this SQLException chain.
Parameters: ex - the new SQLException to be added to the end of the chain |
|
|