Methods Summary |
---|
public static org.hibernate.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.
return convert( converter, sqlException, message, "???" );
|
public static org.hibernate.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.
JDBCExceptionReporter.logExceptions( sqlException, message + " [" + sql + "]" );
return converter.convert( sqlException, message, sql );
|
public static java.lang.String | determineSqlStateClassCode(java.lang.String sqlState)
if ( sqlState == null || sqlState.length() < 2 ) {
return sqlState;
}
return sqlState.substring( 0, 2 );
|
public static int | extractErrorCode(java.sql.SQLException sqlException)For the given SQLException, locates the vendor-specific error code.
int errorCode = sqlException.getErrorCode();
SQLException nested = sqlException.getNextException();
while ( errorCode == 0 && nested != null ) {
errorCode = nested.getErrorCode();
nested = nested.getNextException();
}
return errorCode;
|
public static java.lang.String | extractSqlState(java.sql.SQLException sqlException)For the given SQLException, locates the X/Open-compliant SQLState.
String sqlState = sqlException.getSQLState();
SQLException nested = sqlException.getNextException();
while ( sqlState == null && nested != null ) {
sqlState = nested.getSQLState();
nested = nested.getNextException();
}
return sqlState;
|
public static java.lang.String | extractSqlStateClassCode(java.sql.SQLException sqlException)For the given SQLException, locates the X/Open-compliant SQLState's class code.
return determineSqlStateClassCode( extractSqlState( sqlException ) );
|