| Modifier and Type | Class and Description |
|---|---|
| public static class | SqlExceptionHelper.StandardWarningHandler
Standard SQLWarning handler for logging warnings |
| public static interface | SqlExceptionHelper.WarningHandler
Contract for handling warnings |
| public abstract static class | SqlExceptionHelper.WarningHandlerLoggingSupport
Basic support for |
| Modifier and Type | Field and Description |
|---|---|
| private static final SQLExceptionConverter | |
| private static final String | |
| private static final String | |
| private static final CoreMessageLogger | |
| private final boolean | |
| private SQLExceptionConverter | |
| public static final SqlExceptionHelper. | STANDARD_WARNING_HANDLER
Static access to the standard handler for logging warnings |
| Access | Constructor and Description |
|---|---|
| public | SqlExceptionHelper(boolean logWarnings)
Create an exception helper with a default exception converter. |
| public | SqlExceptionHelper(SQLExceptionConverter
The exception converter to use. sqlExceptionConverter, boolean logWarnings)Create an exception helper with a specific exception converter. |
| Modifier and Type | Method and Description |
|---|---|
| public JDBCException | Returns: The converted exceptionThe exception to convert sqlException, String An error message. message)Convert an SQLException using the current converter, doing some logging first. |
| public JDBCException | Returns: The converted exceptionThe exception to convert sqlException, String An error message. message, String The SQL being executed when the exception occurred sql)Convert an SQLException using the current converter, doing some logging first. |
| public JDBCException | Returns: The converted exceptionThe exception to convert sqlException, Supplier<String> An error message supplier. messageSupplier, String The SQL being executed when the exception occurred sql)Convert an SQLException using the current converter, doing some logging first. |
| public SQLExceptionConverter | Returns: The current exception converter.Access the current exception converter being used internally. |
| public void | handleAndClearWarnings(Connection
The JDBC connection potentially containing warnings connection, SqlExceptionHelper.The handler for each individual warning in the stack. handlerGeneral purpose handling of warnings associated with a JDBC |
| public void | handleAndClearWarnings(Statement
The JDBC statement potentially containing warnings statement, SqlExceptionHelper.The handler for each individual warning in the stack. handlerGeneral purpose handling of warnings associated with a JDBC |
| public void | logAndClearWarnings(Connection
The JDBC connection potentially containing warnings connection)Standard (legacy) behavior for logging warnings associated with a JDBC |
| public void | |
| public void | logExceptions(SQLException
The exception to log sqlException, String The message text to use as a preamble. message)Log the given (and any nested) exception. |
| public void | setSqlExceptionConverter(SQLExceptionConverter
the converter to use, or sqlExceptionConverter)null if the default converter should be usedInject the exception converter to use. |
| public void | walkWarnings(SQLWarning
The warning to walk warning, SqlExceptionHelper.The handler handlerGeneric algorithm to walk the hierarchy of SQLWarnings |
| DEFAULT_CONVERTER | back to summary |
|---|---|
| private static final SQLExceptionConverter DEFAULT_CONVERTER | |
| DEFAULT_EXCEPTION_MSG | back to summary |
|---|---|
| private static final String DEFAULT_EXCEPTION_MSG | |
| DEFAULT_WARNING_MSG | back to summary |
|---|---|
| private static final String DEFAULT_WARNING_MSG | |
| LOG | back to summary |
|---|---|
| private static final CoreMessageLogger LOG | |
| logWarnings | back to summary |
|---|---|
| private final boolean logWarnings | |
| sqlExceptionConverter | back to summary |
|---|---|
| private SQLExceptionConverter sqlExceptionConverter | |
| STANDARD_WARNING_HANDLER | back to summary |
|---|---|
| public static final SqlExceptionHelper. Static access to the standard handler for logging warnings | |
| SqlExceptionHelper | back to summary |
|---|---|
| public SqlExceptionHelper(boolean logWarnings) Create an exception helper with a default exception converter. | |
| SqlExceptionHelper | back to summary |
|---|---|
| public SqlExceptionHelper(SQLExceptionConverter sqlExceptionConverter, boolean logWarnings) Create an exception helper with a specific exception converter.
| |
| convert | back to summary |
|---|---|
| public JDBCException convert(SQLException sqlException, String message) Convert an SQLException using the current converter, doing some logging first.
| |
| convert | back to summary |
|---|---|
| public JDBCException convert(SQLException sqlException, String message, String sql) Convert an SQLException using the current converter, doing some logging first.
| |
| convert | back to summary |
|---|---|
| public JDBCException convert(SQLException sqlException, Supplier<String> messageSupplier, String sql) Convert an SQLException using the current converter, doing some logging first.
| |
| getSqlExceptionConverter | back to summary |
|---|---|
| public SQLExceptionConverter getSqlExceptionConverter() Access the current exception converter being used internally.
| |
| handleAndClearWarnings | back to summary |
|---|---|
| public void handleAndClearWarnings(Connection connection, SqlExceptionHelper. General purpose handling of warnings associated with a JDBC
| |
| handleAndClearWarnings | back to summary |
|---|---|
| public void handleAndClearWarnings(Statement statement, SqlExceptionHelper. General purpose handling of warnings associated with a JDBC
| |
| logAndClearWarnings | back to summary |
|---|---|
| public void logAndClearWarnings(Connection connection) Standard (legacy) behavior for logging warnings associated with a JDBC
Calls
| |
| logAndClearWarnings | back to summary |
|---|---|
| public void logAndClearWarnings(Statement statement) | |
| logExceptions | back to summary |
|---|---|
| public void logExceptions(SQLException sqlException, String message) Log the given (and any nested) exception.
| |
| setSqlExceptionConverter | back to summary |
|---|---|
| public void setSqlExceptionConverter(SQLExceptionConverter sqlExceptionConverter) Inject the exception converter to use.
| |
| walkWarnings | back to summary |
|---|---|
| public void walkWarnings(SQLWarning warning, SqlExceptionHelper. Generic algorithm to walk the hierarchy of SQLWarnings
| |
| Modifier and Type | Field and Description |
|---|---|
| private final String |
| Access | Constructor and Description |
|---|---|
| public | StandardWarningHandler(String
The introduction message for the hierarchy introMessage)Creates a StandardWarningHandler |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | doProcess()
Implements org. |
| protected void | logWarning(String
A description of the warning description, String The warning message message)Implements abstract org. |
| public void | prepare(SQLWarning
The first warning in the stack. warning)Implements org. |
| introMessage | back to summary |
|---|---|
| private final String introMessage | |
| StandardWarningHandler | back to summary |
|---|---|
| public StandardWarningHandler(String introMessage) Creates a StandardWarningHandler
| |
| doProcess | back to summary |
|---|---|
| public boolean doProcess() Implements org. Doc from org. Should processing be done? Allows short-circuiting if not.
| |
| logWarning | back to summary |
|---|---|
| protected void logWarning(String description, String message) Implements abstract org. Doc from org. Delegate to log common details of a warning | |
| prepare | back to summary |
|---|---|
| public void prepare(SQLWarning warning) Implements org. Doc from org. Prepare for processing of a warning stack.
Note that the warning here is also the first passed to
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public void | |
| public void | prepare(SQLWarning
The first warning in the stack. warning)Prepare for processing of a warning stack. |
| doProcess | back to summary |
|---|---|
| public boolean doProcess() Should processing be done? Allows short-circuiting if not.
| |
| handleWarning | back to summary |
|---|---|
| public void handleWarning(SQLWarning warning) Handle an individual warning in the stack.
| |
| prepare | back 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
| |
WarningHandler implementations which handle warnings
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | handleWarning(SQLWarning
The warning to handle. warning)Implements org. |
| protected abstract void | logWarning(String
A description of the warning description, String The warning message message)Delegate to log common details of a warning |
| WarningHandlerLoggingSupport | back to summary |
|---|---|
| public WarningHandlerLoggingSupport() | |
| handleWarning | back to summary |
|---|---|
| public final void handleWarning(SQLWarning warning) Implements org. Doc from org. Handle an individual warning in the stack.
| |
| logWarning | back to summary |
|---|---|
| protected abstract void logWarning(String description, String message) Delegate to log common details of a warning | |