addScript to add a single SQL script location.
addScripts to add multiple SQL script locations.
populate or execute to initialize or clean up the
database using the configured scripts.
DatabasePopulatorUtils, ScriptUtils
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private String | |
| private String[] | |
| private boolean | |
| private boolean | |
| pack-priv List | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ResourceDatabasePopulator(Resource...
the scripts to execute to initialize or clean up the database
(never scripts)null)Construct a new |
| public | ResourceDatabasePopulator(boolean
flag to indicate that all failures in SQL should be
logged but not cause a failure continueOnError, boolean flag to indicate that a failed SQL ignoreFailedDrops, String DROP
statement can be ignoredthe encoding for the supplied SQL scripts
(may be sqlScriptEncoding, Resource... null or empty to indicate platform encoding)the scripts to execute to initialize or clean up the database
(never scripts)null)Construct a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | addScripts(Resource...
the scripts to execute (never scripts)null)Add multiple scripts to execute to initialize or clean up the database. |
| private void | |
| public void | execute(DataSource
the dataSource)DataSource to execute against (never null)Execute this |
| public void | populate(Connection
the JDBC connection to use; already configured and
ready to use; never connection)nullImplements org. Populate, initialize, or clean up the database using the provided JDBC connection. |
| public void | setBlockCommentEndDelimiter(String
the end delimiter for block comments
(never blockCommentEndDelimiter)null or empty)Set the end delimiter that identifies block comments within the SQL scripts. |
| public void | setBlockCommentStartDelimiter(String
the start delimiter for block comments
(never blockCommentStartDelimiter)null or empty)Set the start delimiter that identifies block comments within the SQL scripts. |
| public void | setCommentPrefix(String
the prefix for single-line comments commentPrefix)Set the prefix that identifies single-line comments within the SQL scripts. |
| public void | setCommentPrefixes(String...
the prefixes for single-line comments commentPrefixes)Set the prefixes that identify single-line comments within the SQL scripts. |
| public void | setContinueOnError(boolean
true if script execution should continue on errorFlag to indicate that all failures in SQL should be logged but not cause a failure. |
| public void | setIgnoreFailedDrops(boolean
true if failed drop statements should be ignoredFlag to indicate that a failed SQL |
| public void | setScripts(Resource...
the scripts to execute (never scripts)null)Set the scripts to execute to initialize or clean up the database, replacing any previously added scripts. |
| public void | setSeparator(String
the script statement separator separator)Specify the statement separator, if a custom one. |
| public void | setSqlScriptEncoding(String
the encoding used in scripts
(may be sqlScriptEncoding)null or empty to indicate platform encoding)Specify the encoding for the configured SQL scripts, if different from the platform encoding. |
| blockCommentEndDelimiter | back to summary |
|---|---|
| private String blockCommentEndDelimiter | |
| blockCommentStartDelimiter | back to summary |
|---|---|
| private String blockCommentStartDelimiter | |
| commentPrefixes | back to summary |
|---|---|
| private String[] commentPrefixes | |
| continueOnError | back to summary |
|---|---|
| private boolean continueOnError | |
| ignoreFailedDrops | back to summary |
|---|---|
| private boolean ignoreFailedDrops | |
| scripts | back to summary |
|---|---|
| pack-priv List<Resource> scripts | |
| separator | back to summary |
|---|---|
| private String separator | |
| sqlScriptEncoding | back to summary |
|---|---|
| private String sqlScriptEncoding
| |
| ResourceDatabasePopulator | back to summary |
|---|---|
| public ResourceDatabasePopulator() Construct a new
| |
| ResourceDatabasePopulator | back to summary |
|---|---|
| public ResourceDatabasePopulator(Resource... scripts) Construct a new
| |
| ResourceDatabasePopulator | back to summary |
|---|---|
| public ResourceDatabasePopulator(boolean continueOnError, boolean ignoreFailedDrops, String sqlScriptEncoding, Resource... scripts) Construct a new
| |
| addScript | back to summary |
|---|---|
| public void addScript(Resource script) Add a script to execute to initialize or clean up the database.
| |
| addScripts | back to summary |
|---|---|
| public void addScripts(Resource... scripts) Add multiple scripts to execute to initialize or clean up the database.
| |
| assertContentsOfScriptArray | back to summary |
|---|---|
| private void assertContentsOfScriptArray(Resource... scripts) | |
| execute | back to summary |
|---|---|
| public void execute(DataSource dataSource) throws ScriptException Execute this Delegates to
| |
| populate | back to summary |
|---|---|
| public void populate(Connection connection) throws ScriptException Implements org. Doc from org. Populate, initialize, or clean up the database using the provided JDBC connection. Warning Concrete implementations should not close
the provided Concrete implementations may throw an
| |
| setBlockCommentEndDelimiter | back to summary |
|---|---|
| public void setBlockCommentEndDelimiter(String blockCommentEndDelimiter) Set the end delimiter that identifies block comments within the SQL scripts. Defaults to
| |
| setBlockCommentStartDelimiter | back to summary |
|---|---|
| public void setBlockCommentStartDelimiter(String blockCommentStartDelimiter) Set the start delimiter that identifies block comments within the SQL scripts. Defaults to
| |
| setCommentPrefix | back to summary |
|---|---|
| public void setCommentPrefix(String commentPrefix) Set the prefix that identifies single-line comments within the SQL scripts. Defaults to
| |
| setCommentPrefixes | back to summary |
|---|---|
| public void setCommentPrefixes(String... commentPrefixes) Set the prefixes that identify single-line comments within the SQL scripts. Defaults to
| |
| setContinueOnError | back to summary |
|---|---|
| public void setContinueOnError(boolean continueOnError) Flag to indicate that all failures in SQL should be logged but not cause a failure. Defaults to
| |
| setIgnoreFailedDrops | back to summary |
|---|---|
| public void setIgnoreFailedDrops(boolean ignoreFailedDrops) Flag to indicate that a failed SQL This is useful for a non-embedded database whose SQL dialect does not
support an The default is
| |
| setScripts | back to summary |
|---|---|
| public void setScripts(Resource... scripts) Set the scripts to execute to initialize or clean up the database, replacing any previously added scripts.
| |
| setSeparator | back to summary |
|---|---|
| public void setSeparator(String separator) Specify the statement separator, if a custom one. Defaults to
| |
| setSqlScriptEncoding | back to summary |
|---|---|
| public void setSqlScriptEncoding(String sqlScriptEncoding) Specify the encoding for the configured SQL scripts, if different from the platform encoding.
| |