AbstractClinicTests-context.xml

28 lines | 1.366 kB Blame History Raw Download
<?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:p="http://www.springframework.org/schema/p"
		xmlns:context="http://www.springframework.org/schema/context" 
		xmlns:jdbc="http://www.springframework.org/schema/jdbc"
		xmlns:tx="http://www.springframework.org/schema/tx"
		xsi:schemaLocation="
			http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
			http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
			http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
			http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

	<context:property-placeholder location="classpath:jdbc.properties"/>

	<context:annotation-config/>

	<tx:annotation-driven/>

	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
			p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}"
			p:username="${jdbc.username}" p:password="${jdbc.password}"/>

	<jdbc:initialize-database data-source="dataSource" ignore-failures="ALL">
		<jdbc:script location="${jdbc.initLocation}"/>
		<jdbc:script location="${jdbc.dataLocation}"/>
	</jdbc:initialize-database>
</beans>