Package org.cyclos.impl.utils.jdbc
Class ScriptHelper
- java.lang.Object
-
- org.cyclos.impl.utils.jdbc.ScriptHelper
-
public class ScriptHelper extends Object
Contains helper methods to handle database scripts
-
-
Constructor Summary
Constructors Constructor Description ScriptHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidrun(JdbcTemplate jdbcTemplate, String script, boolean logSuccess, CyclosProperties cyclosProperties)Runs the given script on the given connection.static booleanrunSilently(JdbcTemplate jdbcTemplate, String script, boolean logSuccess, CyclosProperties cyclosProperties)Runs the given script on the given connection, returning whether there where errorsstatic List<String>split(String script)Splits the given script into statements.
-
-
-
Method Detail
-
run
public static void run(JdbcTemplate jdbcTemplate, String script, boolean logSuccess, CyclosProperties cyclosProperties) throws DatabaseUpgradeException
Runs the given script on the given connection.- Throws:
DatabaseUpgradeException- When there is an error in at least one statement contained in the script.
-
runSilently
public static boolean runSilently(JdbcTemplate jdbcTemplate, String script, boolean logSuccess, CyclosProperties cyclosProperties)
Runs the given script on the given connection, returning whether there where errors
-
-