1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -107,7 +107,7 @@ public abstract class ScriptUtils {
107
107
* in a block comment will be omitted from the output. In addition, multiple
108
108
* adjacent whitespace characters will be collapsed into a single space.
109
109
* @param script the SQL script
110
- * @param separator character separating each statement — typically a ';'
110
+ * @param separator character separating each statement ( typically a ';')
111
111
* @param statements the list that will contain the individual statements
112
112
* @throws ScriptException if an error occurred while splitting the SQL script
113
113
* @see #splitSqlScript(String, String, List)
@@ -130,7 +130,8 @@ public static void splitSqlScript(String script, char separator, List<String> st
130
130
* in a block comment will be omitted from the output. In addition, multiple
131
131
* adjacent whitespace characters will be collapsed into a single space.
132
132
* @param script the SQL script
133
- * @param separator text separating each statement — typically a ';' or newline character
133
+ * @param separator text separating each statement
134
+ * (typically a ';' or newline character)
134
135
* @param statements the list that will contain the individual statements
135
136
* @throws ScriptException if an error occurred while splitting the SQL script
136
137
* @see #splitSqlScript(String, char, List)
@@ -153,11 +154,11 @@ public static void splitSqlScript(String script, String separator, List<String>
153
154
* omitted from the output. In addition, multiple adjacent whitespace characters
154
155
* will be collapsed into a single space.
155
156
* @param resource the resource from which the script was read
156
- * @param script the SQL script; never {@code null} or empty
157
- * @param separator text separating each statement — typically a ';' or
158
- * newline character; never {@code null}
159
- * @param commentPrefix the prefix that identifies SQL line comments —
160
- * typically "--"; never {@code null} or empty
157
+ * @param script the SQL script
158
+ * @param separator text separating each statement
159
+ * (typically a ';' or newline character)
160
+ * @param commentPrefix the prefix that identifies SQL line comments
161
+ * ( typically "--")
161
162
* @param blockCommentStartDelimiter the <em>start</em> block comment delimiter;
162
163
* never {@code null} or empty
163
164
* @param blockCommentEndDelimiter the <em>end</em> block comment delimiter;
@@ -270,15 +271,15 @@ static String readScript(EncodedResource resource) throws IOException {
270
271
* a statement — will be included in the results.
271
272
* @param resource the {@code EncodedResource} containing the script
272
273
* to be processed
273
- * @param commentPrefix the prefix that identifies comments in the SQL script —
274
- * typically "--"
275
- * @param separator the statement separator in the SQL script — typically ";"
274
+ * @param commentPrefix the prefix that identifies comments in the SQL script
275
+ * ( typically "--")
276
+ * @param separator the statement separator in the SQL script ( typically ";")
276
277
* @param blockCommentEndDelimiter the <em>end</em> block comment delimiter
277
278
* @return a {@code String} containing the script lines
278
279
* @throws IOException in case of I/O errors
279
280
*/
280
281
private static String readScript (EncodedResource resource , @ Nullable String commentPrefix ,
281
- @ Nullable String separator , @ Nullable String blockCommentEndDelimiter ) throws IOException {
282
+ @ Nullable String separator , @ Nullable String blockCommentEndDelimiter ) throws IOException {
282
283
283
284
LineNumberReader lnr = new LineNumberReader (resource .getReader ());
284
285
try {
@@ -298,15 +299,15 @@ private static String readScript(EncodedResource resource, @Nullable String comm
298
299
* a statement — will be included in the results.
299
300
* @param lineNumberReader the {@code LineNumberReader} containing the script
300
301
* to be processed
301
- * @param lineCommentPrefix the prefix that identifies comments in the SQL script —
302
- * typically "--"
303
- * @param separator the statement separator in the SQL script — typically ";"
302
+ * @param lineCommentPrefix the prefix that identifies comments in the SQL script
303
+ * ( typically "--")
304
+ * @param separator the statement separator in the SQL script ( typically ";")
304
305
* @param blockCommentEndDelimiter the <em>end</em> block comment delimiter
305
306
* @return a {@code String} containing the script lines
306
307
* @throws IOException in case of I/O errors
307
308
*/
308
309
public static String readScript (LineNumberReader lineNumberReader , @ Nullable String lineCommentPrefix ,
309
- @ Nullable String separator , @ Nullable String blockCommentEndDelimiter ) throws IOException {
310
+ @ Nullable String separator , @ Nullable String blockCommentEndDelimiter ) throws IOException {
310
311
311
312
String currentStatement = lineNumberReader .readLine ();
312
313
StringBuilder scriptBuilder = new StringBuilder ();
@@ -434,16 +435,14 @@ public static void executeSqlScript(Connection connection, EncodedResource resou
434
435
* @param ignoreFailedDrops whether or not to continue in the event of specifically
435
436
* an error on a {@code DROP} statement
436
437
* @param commentPrefix the prefix that identifies single-line comments in the
437
- * SQL script — typically "--"
438
+ * SQL script ( typically "--")
438
439
* @param separator the script statement separator; defaults to
439
440
* {@value #DEFAULT_STATEMENT_SEPARATOR} if not specified and falls back to
440
441
* {@value #FALLBACK_STATEMENT_SEPARATOR} as a last resort; may be set to
441
442
* {@value #EOF_STATEMENT_SEPARATOR} to signal that the script contains a
442
443
* single statement without a separator
443
- * @param blockCommentStartDelimiter the <em>start</em> block comment delimiter; never
444
- * {@code null} or empty
445
- * @param blockCommentEndDelimiter the <em>end</em> block comment delimiter; never
446
- * {@code null} or empty
444
+ * @param blockCommentStartDelimiter the <em>start</em> block comment delimiter
445
+ * @param blockCommentEndDelimiter the <em>end</em> block comment delimiter
447
446
* @throws ScriptException if an error occurred while executing the SQL script
448
447
* @see #DEFAULT_STATEMENT_SEPARATOR
449
448
* @see #FALLBACK_STATEMENT_SEPARATOR
0 commit comments