Package org.hibernate.exception
Class JDBCExceptionHelper
java.lang.Object
org.hibernate.exception.JDBCExceptionHelper
Implementation of JDBCExceptionHelper.
-
Method Summary
Modifier and TypeMethodDescriptionstatic JDBCExceptionconvert(SQLExceptionConverter converter, SQLException sqlException, String message) Converts the given SQLException into Hibernate's JDBCException hierarchy, as well as performing appropriate logging.static JDBCExceptionconvert(SQLExceptionConverter converter, SQLException sqlException, String message, String sql) Converts the given SQLException into Hibernate's JDBCException hierarchy, as well as performing appropriate logging.static StringdetermineSqlStateClassCode(String sqlState) static intextractErrorCode(SQLException sqlException) For the given SQLException, locates the vendor-specific error code.static StringextractSqlState(SQLException sqlException) For the given SQLException, locates the X/Open-compliant SQLState.static StringextractSqlStateClassCode(SQLException sqlException) For the given SQLException, locates the X/Open-compliant SQLState's class code.
-
Method Details
-
convert
public static JDBCException convert(SQLExceptionConverter converter, SQLException sqlException, String message) Converts the given SQLException into Hibernate's JDBCException hierarchy, as well as performing appropriate logging.- Parameters:
converter- The converter to use.sqlException- The exception to convert.message- An optional error message.- Returns:
- The converted JDBCException.
-
convert
public static JDBCException convert(SQLExceptionConverter converter, SQLException sqlException, String message, String sql) Converts the given SQLException into Hibernate's JDBCException hierarchy, as well as performing appropriate logging.- Parameters:
converter- The converter to use.sqlException- The exception to convert.message- An optional error message.- Returns:
- The converted JDBCException.
-
extractErrorCode
For the given SQLException, locates the vendor-specific error code.- Parameters:
sqlException- The exception from which to extract the SQLState- Returns:
- The error code.
-
extractSqlState
For the given SQLException, locates the X/Open-compliant SQLState.- Parameters:
sqlException- The exception from which to extract the SQLState- Returns:
- The SQLState code, or null.
-
extractSqlStateClassCode
For the given SQLException, locates the X/Open-compliant SQLState's class code.- Parameters:
sqlException- The exception from which to extract the SQLState class code- Returns:
- The SQLState class code, or null.
-
determineSqlStateClassCode
-