Fyi. Instead of the trick, you can use <jdbc:initialize-database> to indicate initialization of the script with all your SQL queries used to initialize db. This way, queries will be easier to maintain.
<jdbc:initialize-database data-source="dataSource"> <jdbc:script location="file:C:/db/initial-query.sql" /> </jdbc:initialize-database>
Remember to include this at the top.
<beans xmlns="http://www.springframework.org/schema/beans" ... xmlns:jdbc="http://www.springframework.org/schema/jdbc" xsi:schemaLocation="... http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
eureka
source share