Package org.springframework.jdbc
Class BadSqlGrammarException
- All Implemented Interfaces:
Serializable
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.
- Author:
- Rod Johnson
- See Also:
-
Constructor Summary
ConstructorDescriptionBadSqlGrammarException
(String task, String sql, SQLException ex) Constructor for BadSqlGrammarException. -
Method Summary
Modifier and TypeMethodDescriptiongetSql()
Return the SQL that caused the problem.Return the wrapped SQLException.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
-
Constructor Details
-
BadSqlGrammarException
Constructor for BadSqlGrammarException.- Parameters:
task
- name of current tasksql
- the offending SQL statementex
- the root cause
-
-
Method Details
-
getSQLException
Return the wrapped SQLException. -
getSql
Return the SQL that caused the problem.
-