Skip to content

Commit 291b3de

Browse files
committed
Refer to statement numbers in ScriptStatementFailedException
ScriptStatementFailedException now properly refers to statement numbers instead of line numbers. Issue: SPR-12752
1 parent 228d9db commit 291b3de

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptStatementFailedException.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,12 +32,13 @@ public class ScriptStatementFailedException extends ScriptException {
3232
/**
3333
* Construct a new {@code ScriptStatementFailedException}.
3434
* @param statement the actual SQL statement that failed
35-
* @param lineNumber the line number in the SQL script
35+
* @param statementNumber the statement number in the SQL script (i.e.,
36+
* the nth statement present in the resource)
3637
* @param resource the resource from which the SQL statement was read
3738
* @param cause the underlying cause of the failure
3839
*/
39-
public ScriptStatementFailedException(String statement, int lineNumber, EncodedResource resource, Throwable cause) {
40-
super("Failed to execute SQL script statement at line " + lineNumber + " of resource " + resource + ": "
40+
public ScriptStatementFailedException(String statement, int statementNumber, EncodedResource resource, Throwable cause) {
41+
super("Failed to execute SQL script statement #" + statementNumber + " of resource " + resource + ": "
4142
+ statement, cause);
4243
}
4344

0 commit comments

Comments
 (0)