Top Description Constructors Methods
org.springframework.r2dbc.connection.init

public Class ScriptStatementFailedException

extends ScriptException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
org.springframework.core.io.support.EncodedResource

Thrown by ScriptUtils if a statement in an SQL script failed when executing it against the target database.
Authors
Juergen Hoeller, Sam Brannen, Mark Paluch
Since
5.3

Constructor Summary

AccessConstructor and Description
public
ScriptStatementFailedException(String
the actual SQL statement that failed
stmt
,
int
the statement number in the SQL script (i.e., the nth statement present in the resource)
stmtNumber
,
EncodedResource
the resource from which the SQL statement was read
encodedResource
,
Throwable
the underlying cause of the failure
cause
)

Create a new ScriptStatementFailedException.

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

an error message suitable for an exception's detail message or logging
buildErrorMessage
(String
the actual SQL statement that failed
stmt
,
int
the statement number in the SQL script (i.e., the nth statement present in the resource)
stmtNumber
,
EncodedResource
the resource from which the SQL statement was read
encodedResource
)

Build an error message for an SQL script execution failure, based on the supplied arguments.

Constructor Detail

ScriptStatementFailedExceptionback to summary
public ScriptStatementFailedException(String stmt, int stmtNumber, EncodedResource encodedResource, Throwable cause)

Create a new ScriptStatementFailedException.

Parameters
stmt:String

the actual SQL statement that failed

stmtNumber:int

the statement number in the SQL script (i.e., the nth statement present in the resource)

encodedResource:EncodedResource

the resource from which the SQL statement was read

cause:Throwable

the underlying cause of the failure

Method Detail

buildErrorMessageback to summary
public static String buildErrorMessage(String stmt, int stmtNumber, EncodedResource encodedResource)

Build an error message for an SQL script execution failure, based on the supplied arguments.

Parameters
stmt:String

the actual SQL statement that failed

stmtNumber:int

the statement number in the SQL script (i.e., the nth statement present in the resource)

encodedResource:EncodedResource

the resource from which the SQL statement was read

Returns:String

an error message suitable for an exception's detail message or logging