Top Description Constructors Methods
org.hibernate.exception

public final Class JDBCExceptionHelper

extends Object
Class Inheritance
Imports
org.hibernate.JDBCException, org.hibernate.util.JDBCExceptionReporter, java.sql.SQLException

Implementation of JDBCExceptionHelper.
Author
Steve Ebersole

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static JDBCException

Returns:

The converted JDBCException.
convert
(SQLExceptionConverter
The converter to use.
converter
,
SQLException
The exception to convert.
sqlException
,
String
An optional error message.
message
)

Converts the given SQLException into Hibernate's JDBCException hierarchy, as well as performing appropriate logging.

public static JDBCException

Returns:

The converted JDBCException.
convert
(SQLExceptionConverter
The converter to use.
converter
,
SQLException
The exception to convert.
sqlException
,
String
An optional error message.
message
,
String sql)

Converts the given SQLException into Hibernate's JDBCException hierarchy, as well as performing appropriate logging.

public static String
public static int

Returns:

The error code.
extractErrorCode
(SQLException
The exception from which to extract the SQLState
sqlException
)

For the given SQLException, locates the vendor-specific error code.

public static String

Returns:

The SQLState code, or null.
extractSqlState
(SQLException
The exception from which to extract the SQLState
sqlException
)

For the given SQLException, locates the X/Open-compliant SQLState.

public static String

Returns:

The SQLState class code, or null.
extractSqlStateClassCode
(SQLException
The exception from which to extract the SQLState class code
sqlException
)

For the given SQLException, locates the X/Open-compliant SQLState's class code.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JDBCExceptionHelperback to summary
private JDBCExceptionHelper()

Method Detail

convertback to summary
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:SQLExceptionConverter

The converter to use.

sqlException:SQLException

The exception to convert.

message:String

An optional error message.

Returns:JDBCException

The converted JDBCException.

convertback to summary
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:SQLExceptionConverter

The converter to use.

sqlException:SQLException

The exception to convert.

message:String

An optional error message.

Returns:JDBCException

The converted JDBCException.

determineSqlStateClassCodeback to summary
public static String determineSqlStateClassCode(String sqlState)
extractErrorCodeback to summary
public static int extractErrorCode(SQLException sqlException)

For the given SQLException, locates the vendor-specific error code.

Parameters
sqlException:SQLException

The exception from which to extract the SQLState

Returns:int

The error code.

extractSqlStateback to summary
public static String extractSqlState(SQLException sqlException)

For the given SQLException, locates the X/Open-compliant SQLState.

Parameters
sqlException:SQLException

The exception from which to extract the SQLState

Returns:String

The SQLState code, or null.

extractSqlStateClassCodeback to summary
public static String extractSqlStateClassCode(SQLException sqlException)

For the given SQLException, locates the X/Open-compliant SQLState's class code.

Parameters
sqlException:SQLException

The exception from which to extract the SQLState class code

Returns:String

The SQLState class code, or null.