public class SqlScriptRunner extends Object
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
delimP
regex to detect delimiter.
|
| Constructor and Description |
|---|
SqlScriptRunner()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
static QueryResult |
execCommand(Connection conn,
String command) |
static Map<Long,Long> |
execInsert(Connection conn,
List<InsertionDto> insertions)
Execute the different SQL insertions.
|
static Long |
execInsert(Connection conn,
String command) |
List<String> |
readCommands(Reader reader) |
static void |
runCommands(Connection connection,
List<String> commands) |
static void |
runScript(Connection connection,
Reader reader)
Runs an SQL script (read in using the Reader parameter)
|
static void |
runScriptFromResourceFile(Connection connection,
String resourcePath) |
void |
setDelimiter(String delimiter,
boolean fullLineDelimiter) |
public static final Pattern delimP
public void setDelimiter(String delimiter, boolean fullLineDelimiter)
public static void runScript(Connection connection, Reader reader)
reader - - the source of the scriptpublic static void runScriptFromResourceFile(Connection connection, String resourcePath)
public static void runCommands(Connection connection, List<String> commands)
public static Map<Long,Long> execInsert(Connection conn, List<InsertionDto> insertions) throws SQLException
SQLExceptionpublic static Long execInsert(Connection conn, String command) throws SQLException
null otherwiseSQLExceptionpublic static QueryResult execCommand(Connection conn, String command) throws SQLException
SQLExceptionCopyright © 2016–2019. All rights reserved.