-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatasource-context.xml
46 lines (37 loc) · 1.88 KB
/
datasource-context.xml
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
40
41
42
43
44
45
46
<?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:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">
<bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp2.BasicDataSource">
<!-- MySQL / -->
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/coherence_tools_test" />
<property name="username" value="root" />
<!-- Oracle / -->
<!-- property name="driverClassName" value="oracle.jdbc.OracleDriver" / -->
<!-- property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"
/ -->
<!-- property name="username" value="scott" / -->
<!-- property name="password" value="tiger" / -->
<property name="validationQuery" value="SELECT 1 FROM DUAL" />
<property name="initialSize" value="3" />
<property name="testOnBorrow" value="true" />
<property name="testWhileIdle" value="true" />
<property name="timeBetweenEvictionRunsMillis" value="60000" />
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
<!-- MySQL / -->
<property name="databaseProductName" value="MySQL" />
<!-- Oracle / -->
<!-- property name="databaseProductName" value="Oracle" / -->
</bean>
</beans>