Package org.springframework.jdbc

# Class SQLWarningException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.dao.DataAccessException
org.springframework.dao.NonTransientDataAccessException
org.springframework.dao.UncategorizedDataAccessException
org.springframework.jdbc.SQLWarningException

All Implemented Interfaces:
  `Serializable`

public class SQLWarningException extends org.springframework.dao.UncategorizedDataAccessException
Exception thrown when we're not ignoring `SQLWarnings`.

If an SQLWarning is reported, the operation completed, so we will need to explicitly roll it back if we're not happy when looking at the warning. We might choose to ignore (and log) the warning, or to wrap and throw it in the shape of this SQLWarningException instead.

Author:
  Rod Johnson, Juergen Hoeller
See Also:
  - `JdbcTemplate.setIgnoreWarnings(boolean)`
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`SQLWarningException(String msg, SQLWarning ex)`
Constructor for SQLWarningException.

## Method Summary

Modifier and Type
Method
Description
`SQLWarning`
`getSQLWarning()`
Return the underlying `SQLWarning`.
`SQLWarning`
`SQLWarning()`
Deprecated.
as of 5.3.29, in favor of `getSQLWarning()`

### Methods inherited from class org.springframework.core.NestedRuntimeException

`contains, getMostSpecificCause, getRootCause`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SQLWarningException

public SQLWarningException(String msg, SQLWarning ex)
Constructor for SQLWarningException.

Parameters:
  `msg` - the detail message
  `ex` - the JDBC warning

## Method Details

### getSQLWarning

@Nullable public SQLWarning getSQLWarning()
Return the underlying `SQLWarning`.

Since:
  5.3.29

### SQLWarning

@Deprecated(since="5.3.29") @Nullable public SQLWarning SQLWarning()
Deprecated.
as of 5.3.29, in favor of `getSQLWarning()`
Return the underlying `SQLWarning`.