Class SQLException

public class SQLException extends Exception

This type of exception is thrown when database access errors happen. The SQLExceptions are chained together.

Constructors

SQLException

public SQLException(String reason, String SQLState, int vendorCode)

This creates a SQLException object providing a reason, an XOPEN SQLState, and a vendor code.

Parameters:

reason:

A short message for the exception

SQLState:

An XOPEN code to identify the exception

vendorCode:

A database vendor exception code

SQLException

public SQLException(String reason, String SQLState)

This creates a SQLException object providing a reason and an XOPEN SQLState. The vendorCode is set to 0.

Parameters:

reason:

A short message for the exception

SQLState:

An XOPEN code to identify the exception

SQLException

public SQLException(String reason)

This creates a SQLException object providing a reason. The SQLState is set to null and the vendorCode is set to 0.

Parameters:

reason:

A short message for the exception

SQLException

public SQLException()

This creates a SQLException object without providing additional information. The message and the SQLState are set to null, and the vendorCode is set to 0.

Methods

getErrorCode

public int getErrorCode()

This gets the vendor code for the exception.

Returns: The vendorCode value for the exception

getNextException

public SQLException getNextException()

This gets the exception chained to the current exception.

Returns: The next SQLException

getSQLState

public String getSQLState()

This gets the SQLState for the exception.

Returns: The SQLState value for the exception

setNextException

public synchronized void setNextException(SQLException ex)

This adds a SQLExceptions.

Parameters:

ex:

A new SQLException



JDBC 3. 0. JAVA Database Connectivity
JDBC 3: Java Database Connectivity
ISBN: 0764548751
EAN: 2147483647
Year: 2002
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net