org.hibernate.exception
Class JDBCExceptionHelper
java.lang.Object
org.hibernate.exception.JDBCExceptionHelper
public final class JDBCExceptionHelper
extends java.lang.Object
Implementation of JDBCExceptionHelper.
static JDBCException | convert(SQLExceptionConverter converter, SQLException sqlException, String message) - Converts the given SQLException into Hibernate's JDBCException hierarchy, as well as performing
appropriate logging.
|
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.
|
static String | determineSqlStateClassCode(String sqlState)
|
static int | extractErrorCode(SQLException sqlException) - For the given SQLException, locates the vendor-specific error code.
|
static String | extractSqlState(SQLException sqlException) - For the given SQLException, locates the X/Open-compliant SQLState.
|
static String | extractSqlStateClassCode(SQLException sqlException) - For the given SQLException, locates the X/Open-compliant SQLState's class code.
|
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.
converter
- The converter to use.sqlException
- The exception to convert.message
- An optional error message.
- 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.
converter
- The converter to use.sqlException
- The exception to convert.message
- An optional error message.
- The converted JDBCException.
determineSqlStateClassCode
public static String determineSqlStateClassCode(String sqlState)
extractErrorCode
public static int extractErrorCode(SQLException sqlException)
For the given SQLException, locates the vendor-specific error code.
sqlException
- The exception from which to extract the SQLState
extractSqlState
public static String extractSqlState(SQLException sqlException)
For the given SQLException, locates the X/Open-compliant SQLState.
sqlException
- The exception from which to extract the SQLState
- The SQLState code, or null.
extractSqlStateClassCode
public static String extractSqlStateClassCode(SQLException sqlException)
For the given SQLException, locates the X/Open-compliant SQLState's class code.
sqlException
- The exception from which to extract the SQLState class code
- The SQLState class code, or null.