A simple example using SimpleJdbcTemplate
.
The Spring JDBC Template just needs a DataSource
. This DataSource
automatically initializes an HSQL DB with the schema.sql script.
<bean id="dataSource" class="org.springbyexample.jdbc.datasource.HsqldbInitializingDriverManagerDataSource"> <property name="sqlScriptProcessor"> <bean class="org.springbyexample.jdbc.core.SqlScriptProcessor"> <property name="sqlScripts"> <list> <value>classpath:/schema.sql</value> </list> </property> </bean> </property> </bean>