org.hibernate

Class JDBCException

Implemented Interfaces:
Nestable
Known Direct Subclasses:
ConstraintViolationException, DataException, GenericJDBCException, JDBCConnectionException, LockAcquisitionException, SQLGrammarException

public class JDBCException
extends HibernateException

Wraps an SQLException. Indicates that an exception occurred during a JDBC call.
Author:
Gavin King
See Also:
java.sql.SQLException

Field Summary

Fields inherited from class org.hibernate.exception.NestableRuntimeException

delegate

Constructor Summary

JDBCException(String string, SQLException root)
JDBCException(String string, SQLException root, String sql)

Method Summary

int
getErrorCode()
Get the errorCode of the underlying SQLException.
String
getSQL()
Get the actual SQL statement that caused the exception (may be null)
SQLException
getSQLException()
Get the underlying SQLException.
String
getSQLState()
Get the SQLState of the underlying SQLException.

Methods inherited from class org.hibernate.exception.NestableRuntimeException

getCause, getMessage, getMessage, getMessages, getThrowable, getThrowableCount, getThrowables, indexOfThrowable, indexOfThrowable, printPartialStackTrace, printStackTrace, printStackTrace, printStackTrace

Constructor Details

JDBCException

public JDBCException(String string,
                     SQLException root)

JDBCException

public JDBCException(String string,
                     SQLException root,
                     String sql)

Method Details

getErrorCode

public int getErrorCode()
Get the errorCode of the underlying SQLException.
Returns:
int the error code
See Also:
java.sql.SQLException

getSQL

public String getSQL()
Get the actual SQL statement that caused the exception (may be null)

getSQLException

public SQLException getSQLException()
Get the underlying SQLException.
Returns:
SQLException

getSQLState

public String getSQLState()
Get the SQLState of the underlying SQLException.
Returns:
String
See Also:
java.sql.SQLException