spring-framework / org.springframework.jdbc

Package org.springframework.jdbc

Exceptions

BadSqlGrammarException

open class BadSqlGrammarException : InvalidDataAccessResourceUsageException

Exception thrown when SQL specified is invalid. Such exceptions always have a java.sql.SQLException root cause.

It would be possible to have subclasses for no such table, no such column etc. A custom SQLExceptionTranslator could create such more specific exceptions, without affecting code using this class.

CannotGetJdbcConnectionException

open class CannotGetJdbcConnectionException : DataAccessResourceFailureException

Fatal exception thrown when we can't connect to an RDBMS using JDBC.

IncorrectResultSetColumnCountException

open class IncorrectResultSetColumnCountException : DataRetrievalFailureException

Data access exception thrown when a result set did not have the correct column count, for example when expecting a single column but getting 0 or more than 1 columns.

InvalidResultSetAccessException

open class InvalidResultSetAccessException : InvalidDataAccessResourceUsageException

Exception thrown when a ResultSet has been accessed in an invalid fashion. Such exceptions always have a java.sql.SQLException root cause.

This typically happens when an invalid ResultSet column index or name has been specified. Also thrown by disconnected SqlRowSets.

JdbcUpdateAffectedIncorrectNumberOfRowsException

open class JdbcUpdateAffectedIncorrectNumberOfRowsException : IncorrectUpdateSemanticsDataAccessException

Exception thrown when a JDBC update affects an unexpected number of rows. Typically we expect an update to affect a single row, meaning it's an error if it affects multiple rows.

LobRetrievalFailureException

open class LobRetrievalFailureException : DataRetrievalFailureException

Exception to be thrown when a LOB could not be retrieved.

SQLWarningException

open class SQLWarningException : UncategorizedDataAccessException

Exception thrown when we're not ignoring java.sql.SQLWarning.

If a 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.

UncategorizedSQLException

open class UncategorizedSQLException : UncategorizedDataAccessException

Exception thrown when we can't classify a SQLException into one of our generic data access exceptions.