<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">

	<bean id="dbShutdown" class="test.jdbc.datasource.DerbyShutdownBean">
		<property name="dataSource" ref="dataSource"/>
	</bean>
	
	<bean class="test.jdbc.datasource.DataSourceInitializer" depends-on="dbShutdown">
		<property name="dataSource" ref="dataSource"/>
		<property name="initScripts" value="org/springframework/batch/item/database/init-foo-schema-derby.sql" />
		<property name="destroyScripts" value="org/springframework/batch/item/database/drop-foo-schema-derby.sql"/>
	</bean>

	<bean id="dataSource" class="test.jdbc.datasource.DerbyDataSourceFactoryBean">
		<property name="dataDirectory" value="target/derby-home"/>
	</bean>
	
	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="dataSource" />
	</bean>

</beans>