Refer to statement numbers in ScriptStatementFailedException

ScriptStatementFailedException now properly refers to statement numbers
instead of line numbers.

Issue: SPR-12752
master
Sam Brannen 10 years ago
parent 228d9db4d4
commit 291b3de72b
  1. 9
      spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptStatementFailedException.java

@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -32,12 +32,13 @@ public class ScriptStatementFailedException extends ScriptException {
/**
* Construct a new {@code ScriptStatementFailedException}.
* @param statement the actual SQL statement that failed
* @param lineNumber the line number in the SQL script
* @param statementNumber the statement number in the SQL script (i.e.,
* the nth statement present in the resource)
* @param resource the resource from which the SQL statement was read
* @param cause the underlying cause of the failure
*/
public ScriptStatementFailedException(String statement, int lineNumber, EncodedResource resource, Throwable cause) {
super("Failed to execute SQL script statement at line " + lineNumber + " of resource " + resource + ": "
public ScriptStatementFailedException(String statement, int statementNumber, EncodedResource resource, Throwable cause) {
super("Failed to execute SQL script statement #" + statementNumber + " of resource " + resource + ": "
+ statement, cause);
}

Loading…
Cancel
Save