Package org.dbunit
Class DdlExecutor
java.lang.Object
org.dbunit.DdlExecutor
Test Helper class for Executing DDL.
- Since:
- DbUnit 2.6.0
- Version:
- $Revision$
- Author:
- Andrew Landsverk
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidexecute(String ddlFileName, Connection connection, boolean multiLineSupport) Execute DDL from the file (by name) against the givenConnection, dispatches to executeDdlFile and passes false for ignoreErrors.static voidexecute(String ddlFileName, Connection connection, boolean multiLineSupport, boolean ignoreErrors) Execute DDL from the file (by name) against the givenConnection, dispatches to executeDdlFile.static voidexecuteDdlFile(File ddlFile, Connection connection) Executes DDL from theFileagainst the givenConnection.static voidexecuteDdlFile(File ddlFile, Connection connection, boolean multiLineSupport) Executes DDL from theFileagainst the givenConnection.static voidexecuteDdlFile(File ddlFile, Connection connection, boolean multiLineSupport, boolean ignoreErrors) Execute DDL from theFileagainst the givenConnection.static voidexecuteSql(Connection connection, String sql) Execute an un-prepared SQL statement against the givenConnection, passes false to ignoreErrors.static voidexecuteSql(Connection connection, String sql, boolean ignoreErrors) Execute an un-prepared SQL statement against the givenConnection.
-
Method Details
-
execute
public static void execute(String ddlFileName, Connection connection, boolean multiLineSupport) throws Exception Execute DDL from the file (by name) against the givenConnection, dispatches to executeDdlFile and passes false for ignoreErrors.- Parameters:
ddlFileName- The name of the DDL file to execute.connection- TheConnectionto execute the DDL against.multiLineSupport- If this DataSource supports passing in all the lines at once or if it needs to separate on ';'.- Throws:
Exception
-
execute
public static void execute(String ddlFileName, Connection connection, boolean multiLineSupport, boolean ignoreErrors) throws Exception Execute DDL from the file (by name) against the givenConnection, dispatches to executeDdlFile.- Parameters:
ddlFileName- The name of the DDL file to execute.connection- TheConnectionto execute the DDL against.multiLineSupport- If this DataSource supports passing in all the lines at once or if it needs to separate on ';'.ignoreErrors- Set this to true if you want syntax errors to be ignored.- Throws:
Exception
-
executeDdlFile
Executes DDL from theFileagainst the givenConnection. Retrieves the multiLineSupport parameter from the profile.- Parameters:
ddlFile- TheFileobject of the DDL file to execute.connection- TheConnectionto execute the DDL against.- Throws:
Exception
-
executeDdlFile
public static void executeDdlFile(File ddlFile, Connection connection, boolean multiLineSupport) throws Exception Executes DDL from theFileagainst the givenConnection. Retrieves the multiLineSupport parameter from the profile and passes false for ignoreErrors.- Parameters:
ddlFile- TheFileobject of the DDL file to execute.connection- TheConnectionto execute the DDL against.multiLineSupport- If this DataSource supports passing in all the lines at once or if it needs to separate on ';'.- Throws:
Exception
-
executeDdlFile
public static void executeDdlFile(File ddlFile, Connection connection, boolean multiLineSupport, boolean ignoreErrors) throws Exception Execute DDL from theFileagainst the givenConnection.- Parameters:
ddlFile- TheFileobject of the DDL file to execute.connection- TheConnectionto execute the DDL against.multiLineSupport- If this DataSource supports passing in all the lines at once or if it needs to separate on ';'.ignoreErrors- Set this to true if you want syntax errors to be ignored.- Throws:
Exception
-
executeSql
Execute an un-prepared SQL statement against the givenConnection, passes false to ignoreErrors.- Parameters:
connection- TheConnectionto execute againstsql- The SQLStringto execute- Throws:
SQLException
-
executeSql
public static void executeSql(Connection connection, String sql, boolean ignoreErrors) throws SQLException Execute an un-prepared SQL statement against the givenConnection.- Parameters:
connection- TheConnectionto execute againstsql- The SQLStringto executeignoreErrors- Set this to true if you want syntax errors to be ignored.- Throws:
SQLException
-