程序包 org.hibernate
类 JDBCException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- javax.persistence.PersistenceException
-
- org.hibernate.HibernateException
-
- org.hibernate.JDBCException
-
- 所有已实现的接口:
Serializable
- 直接已知子类:
ConstraintViolationException,DataException,GenericJDBCException,JDBCConnectionException,LockAcquisitionException,PessimisticLockException,QueryTimeoutException,SQLGrammarException
public class JDBCException extends HibernateException
Wraps aSQLException. Indicates that an exception occurred during a JDBC call.- 作者:
- Gavin King
- 另请参阅:
SQLException, 序列化表格
-
-
构造器概要
构造器 构造器 说明 JDBCException(String message, SQLException cause)Constructs a JDBCException using the given information.JDBCException(String message, SQLException cause, String sql)Constructs a JDBCException using the given information.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 intgetErrorCode()Get the vendor specific error code from the underlyingSQLException.StringgetSQL()Get the actual SQL statement being executed when the exception occurred.SQLExceptiongetSQLException()Get the underlyingSQLException.StringgetSQLState()Get the X/Open or ANSI SQL SQLState error code from the underlyingSQLException.
-
-
-
构造器详细资料
-
JDBCException
public JDBCException(String message, SQLException cause)
Constructs a JDBCException using the given information.- 参数:
message- The message explaining the exception conditioncause- The underlying cause
-
JDBCException
public JDBCException(String message, SQLException cause, String sql)
Constructs a JDBCException using the given information.- 参数:
message- The message explaining the exception conditioncause- The underlying causesql- The sql being executed when the exception occurred
-
-
方法详细资料
-
getSQLState
public String getSQLState()
Get the X/Open or ANSI SQL SQLState error code from the underlyingSQLException.- 返回:
- The X/Open or ANSI SQL SQLState error code; may return null.
- 另请参阅:
SQLException.getSQLState()
-
getErrorCode
public int getErrorCode()
Get the vendor specific error code from the underlyingSQLException.- 返回:
- The vendor specific error code
- 另请参阅:
SQLException.getErrorCode()
-
getSQLException
public SQLException getSQLException()
Get the underlyingSQLException.- 返回:
- The SQLException
-
getSQL
public String getSQL()
Get the actual SQL statement being executed when the exception occurred.- 返回:
- The SQL statement; may return null.
-
-