Polishing

This commit is contained in:
Juergen Hoeller
2015-02-27 22:29:42 +01:00
parent c1a9e3484a
commit 2b3409461f
6 changed files with 51 additions and 49 deletions

View File

@@ -29,18 +29,6 @@ import org.springframework.core.io.support.EncodedResource;
@SuppressWarnings("serial")
public class ScriptStatementFailedException extends ScriptException {
/**
* Build an error message based on the supplied parameters.
* @param statement the actual SQL statement that failed
* @param statementNumber the statement number in the SQL script (i.e.,
* the nth statement present in the resource)
* @param encodedResource the resource from which the SQL statement was read
*/
public static String buildErrorMessage(String statement, int statementNumber, EncodedResource encodedResource) {
return String.format("Failed to execute SQL script statement #%s of %s: %s",
statementNumber, encodedResource, statement);
}
/**
* Construct a new {@code ScriptStatementFailedException}.
* @param statement the actual SQL statement that failed
@@ -53,4 +41,16 @@ public class ScriptStatementFailedException extends ScriptException {
super(buildErrorMessage(statement, statementNumber, resource), cause);
}
/**
* Build an error message based on the supplied parameters.
* @param statement the actual SQL statement that failed
* @param statementNumber the statement number in the SQL script (i.e.,
* the nth statement present in the resource)
* @param encodedResource the resource from which the SQL statement was read
*/
public static String buildErrorMessage(String statement, int statementNumber, EncodedResource encodedResource) {
return String.format("Failed to execute SQL script statement #%s of %s: %s",
statementNumber, encodedResource, statement);
}
}