Class ScriptStatementFailedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.dao.DataAccessException
org.springframework.r2dbc.connection.init.ScriptException
org.springframework.r2dbc.connection.init.ScriptStatementFailedException
- All Implemented Interfaces:
- Serializable
Thrown by 
ScriptUtils if a statement in an SQL script failed when
executing it against the target database.- Since:
- 5.3
- Author:
- Juergen Hoeller, Sam Brannen, Mark Paluch
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionScriptStatementFailedException(String stmt, int stmtNumber, EncodedResource encodedResource, Throwable cause) Create a newScriptStatementFailedException.
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringbuildErrorMessage(String stmt, int stmtNumber, EncodedResource encodedResource) Build an error message for an SQL script execution failure, based on the supplied arguments.Methods inherited from class NestedRuntimeExceptioncontains, getMostSpecificCause, getRootCauseMethods inherited from class ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
ScriptStatementFailedExceptionpublic ScriptStatementFailedException(String stmt, int stmtNumber, EncodedResource encodedResource, Throwable cause) Create a newScriptStatementFailedException.- Parameters:
- stmt- the actual SQL statement that failed
- stmtNumber- the statement number in the SQL script (i.e., the nth statement present in the resource)
- encodedResource- the resource from which the SQL statement was read
- cause- the underlying cause of the failure
 
 
- 
- 
Method Details- 
buildErrorMessagepublic 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- the actual SQL statement that failed
- stmtNumber- the statement number in the SQL script (i.e., the nth statement present in the resource)
- encodedResource- the resource from which the SQL statement was read
- Returns:
- an error message suitable for an exception's detail message or logging
 
 
-