org.hibernate
Class JDBCException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.hibernate.HibernateException
                  extended by org.hibernate.JDBCException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConstraintViolationException, DataException, GenericJDBCException, JDBCConnectionException, LockAcquisitionException, PessimisticLockException, QueryTimeoutException, SQLGrammarException

public class JDBCException
extends HibernateException

Wraps an SQLException. Indicates that an exception occurred during a JDBC call.

See Also:
SQLException, Serialized Form

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 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

JDBCException

public JDBCException(String string,
                     SQLException root)

JDBCException

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

getSQLState

public String getSQLState()
Get the SQLState of the underlying SQLException.

Returns:
String
See Also:
SQLException

getErrorCode

public int getErrorCode()
Get the errorCode of the underlying SQLException.

Returns:
int the error code
See Also:
SQLException

getSQLException

public SQLException getSQLException()
Get the underlying SQLException.

Returns:
SQLException

getSQL

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



Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.