blob: f57f28babb1d3ddef2439e324f7fc20ce96396bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<?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:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:property-placeholder location="classpath:META-INF/spring/jdbc.properties"/>
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" >
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="accountDAO" class="com.example.spring.bank.dao.jdbc.JDBCAccountDAO" >
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="accountManagerWithNoTransactionSupport" class="com.example.spring.bank.AccountManagerImpl">
<property name="accountDAO" ref="accountDAO"/>
</bean>
<bean id="accountManager" class="com.example.spring.bank.tx.TxAccountManager">
<property name="accountManager" ref="accountManagerWithNoTransactionSupport"/>
<property name="txManager" ref="txManager"/>
</bean>
</beans>
|