public class JDBCException extends HibernateException
Wraps a SQLException. Indicates that an exception occurred during a JDBC call.
SQLException,
Serialized Form| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getErrorCode()
Get the vendor specific error code from the underlying
SQLException. |
String |
getSQL()
Get the actual SQL statement being executed when the exception occurred.
|
SQLException |
getSQLException()
Get the underlying
SQLException. |
String |
getSQLState()
Get the X/Open or ANSI SQL SQLState error code from the underlying
SQLException. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic JDBCException(String message, SQLException cause)
Constructs a JDBCException using the given information.
message - The message explaining the exception conditioncause - The underlying causepublic 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 occurredpublic String getSQLState()
Get the X/Open or ANSI SQL SQLState error code from the underlying SQLException.
SQLException.getSQLState()public int getErrorCode()
Get the vendor specific error code from the underlying SQLException.
SQLException.getErrorCode()public SQLException getSQLException()
Get the underlying SQLException.
public String getSQL()
Get the actual SQL statement being executed when the exception occurred.
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.