Top Description Fields Constructors Methods
org.springframework.jdbc

public Class BadSqlGrammarException

extends InvalidDataAccessResourceUsageException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.sql.SQLException, org.springframework.dao.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.

Author
Rod Johnson
See Also
InvalidResultSetAccessException

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
BadSqlGrammarException(String
name of current task
task
,
String
the offending SQL statement
sql
,
SQLException
the root cause
ex
)

Constructor for BadSqlGrammarException.

Method Summary

Modifier and TypeMethod and Description
public String
getSql()

Return the SQL that caused the problem.

public SQLException
getSQLException()

Return the wrapped SQLException.

Field Detail

sqlback to summary
private final String sql

Constructor Detail

BadSqlGrammarExceptionback to summary
public BadSqlGrammarException(String task, String sql, SQLException ex)

Constructor for BadSqlGrammarException.

Parameters
task:String

name of current task

sql:String

the offending SQL statement

ex:SQLException

the root cause

Method Detail

getSqlback to summary
public String getSql()

Return the SQL that caused the problem.

getSQLExceptionback to summary
public SQLException getSQLException()

Return the wrapped SQLException.