Package org.springframework.jdbc
Class BadSqlGrammarException
- All Implemented Interfaces:
Serializable
public class BadSqlGrammarException extends InvalidDataAccessResourceUsageException
Exception thrown when SQL specified is invalid. Such exceptions always have ajava.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.
- Author:
- Rod Johnson
- See Also:
InvalidResultSetAccessException
, Serialized Form
Constructor Summary
Constructors Constructor Description BadSqlGrammarException(String task, String sql, SQLException ex)
Constructor for BadSqlGrammarException.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getSql()
Return the SQL that caused the problem.SQLException
getSQLException()
Return the wrapped SQLException.Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Detail
BadSqlGrammarException
public BadSqlGrammarException(String task, String sql, SQLException ex)
Constructor for BadSqlGrammarException.- Parameters:
task
- name of current tasksql
- the offending SQL statementex
- the root cause
Method Detail
getSQLException
public SQLException getSQLException()
Return the wrapped SQLException.