is new.
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.sql.SQLException
,
SQLClientInfoException
,
SQLNonTransientException
,
SQLRecoverableException
,
SQLTransientException
,
SQLWarning
,
SyncFactoryException
,
SyncProviderException
public class SQLException
An exception that provides information on a database access error or other errors.
Each SQLException provides several kinds of information:
getMesasge.
a chain to a next Exception. This can be used to provide additional error information.
the causal relationship, if any for this SQLException.
| Constructor Summary | |
|---|---|
|
SQLException
() Constructs a SQLException object. |
|
|
SQLException
(
String
reason) Constructs a SQLException object with a given reason. |
|
|
SQLException
(
String
reason,
String
SQLState) Constructs a SQLException object with a given reason and SQLState. |
|
|
SQLException
(
String
reason,
String
SQLState, int vendorCode) Constructs a SQLException object with a given reason, SQLState and vendorCode. |
|
|
SQLException
(
String
reason,
String
sqlState, int vendorCode,
Throwable
cause) Constructs a SQLException object with a given reason, SQLState, vendorCode and cause. |
|
|
SQLException
(
String
reason,
String
sqlState,
Throwable
cause) Constructs a SQLException object with a given reason, SQLState and cause. |
|
|
SQLException
(
String
reason,
Throwable
cause) Constructs a SQLException object with a given reason and cause. |
|
|
SQLException
(
Throwable
cause) Constructs a SQLException object with a given cause. |
|
| Method Summary | |
|---|---|
| int |
getErrorCode
() Retrieves the vendor-specific exception code for this SQLException object. |
| SQLException |
getNextException
() Retrieves the exception chained to this SQLException object by setNextException(SQLException ex). |
| String |
getSQLState
() Retrieves the SQLState for this SQLException object. |
| Iterator < Throwable |
iterator
() Returns an iterator over
the chained SQLExceptions.
|
| void |
setNextException
(
SQLException
ex) Adds an SQLException object to the end of the chain. |
| Methods inherited from class java.lang. Throwable |
|---|
| fillInStackTrace , getCause , getLocalizedMessage , getMessage , getStackTrace , initCause , printStackTrace , printStackTrace , printStackTrace , setStackTrace , toString |
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
| Constructor Detail |
|---|
public SQLException(String reason,
String SQLState,
int vendorCode)
public SQLException(String reason,
String SQLState)
public SQLException(String reason)
public SQLException()
public SQLException(Throwable cause)
public SQLException(String reason,
Throwable cause)
public SQLException(String reason,
String sqlState,
Throwable cause)
public SQLException(String reason,
String sqlState,
int vendorCode,
Throwable cause)
| Method Detail |
|---|
public String getSQLState()
public int getErrorCode()
public SQLException getNextException()
public void setNextException(SQLException ex)
public Iterator<Throwable> iterator()
Returns an iterator over the chained SQLExceptions. The iterator will be used to iterate over each SQLException and its underlying cause (if any).
an iterator over the chained SQLExceptions and causes in the proper order
Since:
1.6