org.hibernate.exception
public final class JDBCExceptionHelper extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static JDBCException |
convert(SQLExceptionConverter converter,
java.sql.SQLException sqlException,
java.lang.String message)
Converts the given SQLException into Hibernate's JDBCException hierarchy, as well as performing
appropriate logging.
|
static JDBCException |
convert(SQLExceptionConverter converter,
java.sql.SQLException sqlException,
java.lang.String message,
java.lang.String sql)
Converts the given SQLException into Hibernate's JDBCException hierarchy, as well as performing
appropriate logging.
|
static java.lang.String |
determineSqlStateClassCode(java.lang.String sqlState) |
static int |
extractErrorCode(java.sql.SQLException sqlException)
For the given SQLException, locates the vendor-specific error code.
|
static java.lang.String |
extractSqlState(java.sql.SQLException sqlException)
For the given SQLException, locates the X/Open-compliant SQLState.
|
static java.lang.String |
extractSqlStateClassCode(java.sql.SQLException sqlException)
For the given SQLException, locates the X/Open-compliant SQLState's class code.
|
public static JDBCException convert(SQLExceptionConverter converter, java.sql.SQLException sqlException, java.lang.String message)
converter
- The converter to use.sqlException
- The exception to convert.message
- An optional error message.public static JDBCException convert(SQLExceptionConverter converter, java.sql.SQLException sqlException, java.lang.String message, java.lang.String sql)
converter
- The converter to use.sqlException
- The exception to convert.message
- An optional error message.public static int extractErrorCode(java.sql.SQLException sqlException)
sqlException
- The exception from which to extract the SQLStatepublic static java.lang.String extractSqlState(java.sql.SQLException sqlException)
sqlException
- The exception from which to extract the SQLStatepublic static java.lang.String extractSqlStateClassCode(java.sql.SQLException sqlException)
sqlException
- The exception from which to extract the SQLState class codepublic static java.lang.String determineSqlStateClassCode(java.lang.String sqlState)
Copyright © 2014. All Rights Reserved.