AbstractClinicTests-context.xml

32 lines | 1.571 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/>

	<!-- DataSource configuration for Apache Commons DBCP. -->
	<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}"/>
	
	<!-- Database initializer. If any of the script fails, the initialization stops. -->
	<!-- As an alternative, for embedded databases see <jdbc:embedded-database/>. -->
	<jdbc:initialize-database data-source="dataSource">
		<jdbc:script location="${jdbc.initLocation}"/>
		<jdbc:script location="${jdbc.dataLocation}"/>
	</jdbc:initialize-database>
	
</beans>