Top Description Fields Constructors Methods
org.springframework.r2dbc

public Class BadSqlGrammarException

extends InvalidDataAccessResourceUsageException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
io.r2dbc.spi.R2dbcException, org.springframework.dao.InvalidDataAccessResourceUsageException

Exception thrown when SQL specified is invalid. Such exceptions always have a io.r2dbc.spi.R2dbcException root cause.

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

Author
Mark Paluch
Since
5.3

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
,
R2dbcException
the root cause
ex
)

Constructor for BadSqlGrammarException.

Method Summary

Modifier and TypeMethod and Description
public R2dbcException
getR2dbcException()

Return the wrapped R2dbcException.

public String
getSql()

Return the SQL that caused the problem.

Field Detail

sqlback to summary
private final String sql

Constructor Detail

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

Constructor for BadSqlGrammarException.

Parameters
task:String

name of current task

sql:String

the offending SQL statement

ex:R2dbcException

the root cause

Method Detail

getR2dbcExceptionback to summary
public R2dbcException getR2dbcException()

Return the wrapped R2dbcException.

getSqlback to summary
public String getSql()

Return the SQL that caused the problem.