I am using HSQL as my in memory test db for running integration tests. In production, I have an oracle 10g database. The idea is to run the db create scripts that I used to
The way I resolved this was with the following:
<jdbc:initialize-database data-source="dataSource" ignore-failures="DROPS">
<jdbc:script location="file:Artifacts/Hsql Version Scripts/install/droptables.sql" separator=";"/>
<jdbc:script location="file:Artifacts/Hsql Version Scripts/install/install.sql" separator="/;"/>
<jdbc:script location="file:Artifacts/Hsql Version Scripts/patchset/1.0.0.02.create_survey_tables.sql"
separator="/;"/>
<jdbc:script location="file:Artifacts/Hsql Version Scripts/patchset/1.00.01.update.sql" separator=";"/>
<jdbc:script location="file:Artifacts/Hsql Version Scripts/patchset/1.00.03.insert_surveyQA2.sql"
separator=";"/>
<jdbc:script location="file:Artifacts/Hsql Version Scripts/patchset/1.00.05.insert_surveyQA4.sql"
separator=";"/>
</jdbc:initialize-database>
I can specify the delimiter in the script files. So I used a different delimiter /; in the script files that had create procedure statements that had ; separated commands.
1. Terminate each of the SQL statements (insert, create, select etc)
within the script (some_script.sql) with /;
2. Whilst configuring in Spring - add the following:
return new EmbeddedDatabaseBuilder()
.setType("HSQL")
.setName("DBNAME")
.addScript("some_script.sql")
.setSeparator("/;")
.build();