public class SqlScriptRunner
extends java.lang.Object
| Constructor and Description |
|---|
SqlScriptRunner() |
| Modifier and Type | Method and Description |
|---|---|
static void |
runScript(java.sql.Connection connection,
java.lang.String script)
Runs a script of SQL commands.
|
static void |
runScript(java.sql.Connection connection,
java.lang.String script,
java.util.function.BiPredicate<java.lang.String,java.sql.SQLException> exceptionHandler) |
static void |
runScript(java.lang.String dataResourcePath,
DbConfig dbconfig,
java.lang.Class<?> ctxClass) |
public static void runScript(java.sql.Connection connection,
java.lang.String script)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static void runScript(java.sql.Connection connection,
java.lang.String script,
java.util.function.BiPredicate<java.lang.String,java.sql.SQLException> exceptionHandler)
throws java.sql.SQLException
exceptionHandler - allows one to ignore a failed command and continue executing remaining commands.
Note, providing an exceptionHandler changes the execution of commands from a batch operation
to a series of individual statement executions.java.sql.SQLExceptionpublic static void runScript(java.lang.String dataResourcePath,
DbConfig dbconfig,
java.lang.Class<?> ctxClass)
throws java.io.IOException
java.io.IOExceptionCopyright © 2024. All rights reserved.