From 291b3de72bcf290f07ce901c422e7f5031163e99 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 27 Feb 2015 19:30:56 +0100 Subject: [PATCH] Refer to statement numbers in ScriptStatementFailedException ScriptStatementFailedException now properly refers to statement numbers instead of line numbers. Issue: SPR-12752 --- .../datasource/init/ScriptStatementFailedException.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptStatementFailedException.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptStatementFailedException.java index 77c49a1c37..0bb59c5efd 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptStatementFailedException.java +++ b/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); }