Top Inners Fields Constructors Methods
org.hibernate.util

public final Class JDBCExceptionReporter

extends Object
Class Inheritance
Imports
java.sql.Connection, .SQLException, .SQLWarning, .Statement, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static interface
public abstract static class
JDBCExceptionReporter.WarningHandlerLoggingSupport

Basic support for WarningHandler implementations which log

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final Logger
public static JDBCExceptionReporter.StandardWarningHandler

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
handleAndClearWarnings(Connection
The JDBC connection potentially containing warnings
connection
,
JDBCExceptionReporter.WarningHandler
The handler for each individual warning in the stack.
handler
)

General purpose handling of warnings associated with a JDBC Connection.

public static void
handleAndClearWarnings(Statement
The JDBC statement potentially containing warnings
statement
,
JDBCExceptionReporter.WarningHandler
The handler for each individual warning in the stack.
handler
)

General purpose handling of warnings associated with a JDBC Statement.

public static void
logAndClearWarnings(Connection
The JDBC connection potentially containing warnings
connection
)

Standard (legacy) behavior for logging warnings associated with a JDBC Connection and clearing them.

public static void
public static void
public static void
logWarnings(SQLWarning
The warning to log
warning
)

Deprecated Use walkWarnings instead
Log the given warning and all of its nested warnings, preceded with the default message
public static void
logWarnings(SQLWarning
The warning to log
warning
,
String
The prologue message
message
)

Deprecated Use walkWarnings instead
Log the given warning and all of its nested warnings, preceded with the given message
public static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_EXCEPTION_MSGback to summary
public static final String DEFAULT_EXCEPTION_MSG
DEFAULT_WARNING_MSGback to summary
public static final String DEFAULT_WARNING_MSG
logback to summary
public static final Logger log
STANDARD_WARNING_HANDLERback to summary
public static JDBCExceptionReporter.StandardWarningHandler STANDARD_WARNING_HANDLER

Constructor Detail

JDBCExceptionReporterback to summary
private JDBCExceptionReporter()

Method Detail

handleAndClearWarningsback to summary
public static void handleAndClearWarnings(Connection connection, JDBCExceptionReporter.WarningHandler handler)

General purpose handling of warnings associated with a JDBC Connection.

Parameters
connection:Connection

The JDBC connection potentially containing warnings

handler:JDBCExceptionReporter.WarningHandler

The handler for each individual warning in the stack.

Annotations
@SuppressWarnings:ThrowableResultOfMethodCallIgnored
See Also
walkWarnings
handleAndClearWarningsback to summary
public static void handleAndClearWarnings(Statement statement, JDBCExceptionReporter.WarningHandler handler)

General purpose handling of warnings associated with a JDBC Statement.

Parameters
statement:Statement

The JDBC statement potentially containing warnings

handler:JDBCExceptionReporter.WarningHandler

The handler for each individual warning in the stack.

Annotations
@SuppressWarnings:ThrowableResultOfMethodCallIgnored
See Also
walkWarnings
logAndClearWarningsback to summary
public static void logAndClearWarnings(Connection connection)

Standard (legacy) behavior for logging warnings associated with a JDBC Connection and clearing them.

Calls handleAndClearWarnings(Connection, WarningHandler) using STANDARD_WARNING_HANDLER

Parameters
connection:Connection

The JDBC connection potentially containing warnings

logExceptionsback to summary
public static void logExceptions(SQLException ex)
logExceptionsback to summary
public static void logExceptions(SQLException ex, String message)
logWarningsback to summary
public static void logWarnings(SQLWarning warning)

Deprecated

Use walkWarnings instead

Log the given warning and all of its nested warnings, preceded with the default message

Parameters
warning:SQLWarning

The warning to log

Annotations
@Deprecated
@SuppressWarnings:UnusedDeclaration
logWarningsback to summary
public static void logWarnings(SQLWarning warning, String message)

Deprecated

Use walkWarnings instead

Log the given warning and all of its nested warnings, preceded with the given message

Parameters
warning:SQLWarning

The warning to log

message:String

The prologue message

Annotations
@Deprecated
@SuppressWarnings:UnusedDeclaration
walkWarningsback to summary
public static void walkWarnings(SQLWarning warning, JDBCExceptionReporter.WarningHandler handler)
org.hibernate.util back to summary

public Class JDBCExceptionReporter.StandardWarningHandler

extends WarningHandlerLoggingSupport
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
protected void
logWarning(String
A description of the warning
description
,
String
The warning message
message
)

Implements abstract org.hibernate.util.JDBCExceptionReporter.WarningHandlerLoggingSupport.logWarning.

Delegate to log common details of a warning
public void
prepare(SQLWarning
The first warning in the stack.
warning
)

Implements org.hibernate.util.JDBCExceptionReporter.WarningHandler.prepare.

Prepare for processing of a warning stack.
Inherited from org.hibernate.util.JDBCExceptionReporter.WarningHandlerLoggingSupport:
handleWarning

Field Detail

introMessageback to summary
private final String introMessage

Constructor Detail

StandardWarningHandlerback to summary
public StandardWarningHandler(String introMessage)

Method Detail

doProcessback to summary
public boolean doProcess()

Implements org.hibernate.util.JDBCExceptionReporter.WarningHandler.doProcess.

Doc from org.hibernate.util.JDBCExceptionReporter.WarningHandler.doProcess.

Should processing be done? Allows short-circuiting if not.

Returns:boolean

True to process warnings, false otherwise.

logWarningback to summary
protected void logWarning(String description, String message)

Implements abstract org.hibernate.util.JDBCExceptionReporter.WarningHandlerLoggingSupport.logWarning.

Doc from org.hibernate.util.JDBCExceptionReporter.WarningHandlerLoggingSupport.logWarning.

Delegate to log common details of a warning

Parameters
description:String

A description of the warning

message:String

The warning message

Annotations
@Override
prepareback to summary
public void prepare(SQLWarning warning)

Implements org.hibernate.util.JDBCExceptionReporter.WarningHandler.prepare.

Doc from org.hibernate.util.JDBCExceptionReporter.WarningHandler.prepare.

Prepare for processing of a warning stack.

Note that the warning here is also the first passed to handleWarning

Parameters
warning:SQLWarning

The first warning in the stack.

org.hibernate.util back to summary

public Interface JDBCExceptionReporter.WarningHandler

Known Direct Implementers
org.hibernate.util.JDBCExceptionReporter.WarningHandlerLoggingSupport

Contract for handling warnings

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True to process warnings, false otherwise.
doProcess
()

Should processing be done?

public void
handleWarning(SQLWarning
The warning to handle.
warning
)

Handle an individual warning in the stack.

public void
prepare(SQLWarning
The first warning in the stack.
warning
)

Prepare for processing of a warning stack.

Method Detail

doProcessback to summary
public boolean doProcess()

Should processing be done? Allows short-circuiting if not.

Returns:boolean

True to process warnings, false otherwise.

handleWarningback to summary
public void handleWarning(SQLWarning warning)

Handle an individual warning in the stack.

Parameters
warning:SQLWarning

The warning to handle.

prepareback to summary
public void prepare(SQLWarning warning)

Prepare for processing of a warning stack.

Note that the warning here is also the first passed to handleWarning

Parameters
warning:SQLWarning

The first warning in the stack.

org.hibernate.util back to summary

public abstract Class JDBCExceptionReporter.WarningHandlerLoggingSupport

extends Object
implements WarningHandler
Class Inheritance
  • java.lang.Object
  • org.hibernate.util.JDBCExceptionReporter.WarningHandlerLoggingSupport
All Implemented Interfaces
org.hibernate.util.JDBCExceptionReporter.WarningHandler
Known Direct Subclasses
org.hibernate.util.JDBCExceptionReporter.StandardWarningHandler

Basic support for WarningHandler implementations which log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final void
handleWarning(SQLWarning
The warning to handle.
warning
)

Implements org.hibernate.util.JDBCExceptionReporter.WarningHandler.handleWarning.

Handle an individual warning in the stack.
protected abstract void
logWarning(String
A description of the warning
description
,
String
The warning message
message
)

Delegate to log common details of a warning

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

WarningHandlerLoggingSupportback to summary
public WarningHandlerLoggingSupport()

Method Detail

handleWarningback to summary
public final void handleWarning(SQLWarning warning)

Implements org.hibernate.util.JDBCExceptionReporter.WarningHandler.handleWarning.

Doc from org.hibernate.util.JDBCExceptionReporter.WarningHandler.handleWarning.

Handle an individual warning in the stack.

Parameters
warning:SQLWarning

The warning to handle.

logWarningback to summary
protected abstract void logWarning(String description, String message)

Delegate to log common details of a warning

Parameters
description:String

A description of the warning

message:String

The warning message