1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <beans xmlns="http://www.springframework.org/schema/beans" |
---|
3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" |
---|
4 | xmlns:context="http://www.springframework.org/schema/context" |
---|
5 | xsi:schemaLocation=" |
---|
6 | http://www.springframework.org/schema/beans |
---|
7 | http://www.springframework.org/schema/beans/spring-beans.xsd |
---|
8 | http://www.springframework.org/schema/aop |
---|
9 | http://www.springframework.org/schema/aop/spring-aop.xsd |
---|
10 | http://www.springframework.org/schema/context |
---|
11 | http://www.springframework.org/schema/context/spring-context.xsd |
---|
12 | "> |
---|
13 | |
---|
14 | <!-- Using the Datasource JNDI defined in the servlet container. See below |
---|
15 | for a sample Tomcat datasource configuration. We need TransactionAwareDataSourceProxy |
---|
16 | because of the mixed access of plain JDBC and JPA. JDBCTemplate will close |
---|
17 | the database connection otherwise. --> |
---|
18 | |
---|
19 | <bean id="dataSource" |
---|
20 | class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy"> |
---|
21 | <property name="targetDataSource" ref="applicationServerDataSource"/> |
---|
22 | </bean> |
---|
23 | |
---|
24 | |
---|
25 | <bean id="applicationServerDataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> |
---|
26 | <property name="driverClass" value="org.postgresql.Driver" /> |
---|
27 | <property name="url" value="jdbc:postgresql://localhost:5432/component_registry" /> |
---|
28 | <property name="username" value="compreg" /> |
---|
29 | <property name="password" value="compreg" /> |
---|
30 | </bean> |
---|
31 | <!-- |
---|
32 | <bean id="applicationServerDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> |
---|
33 | <property name="jndiName" value="java:comp/env/jdbc/ComponentRegistry" /> |
---|
34 | <property name="resourceRef" value="true" /> |
---|
35 | </bean>--> |
---|
36 | |
---|
37 | <!-- SAMPLE TOMCAT DATASOURCE CONFIGURATION: --> |
---|
38 | <!-- <Context> ... <Resource name="jdbc/ComponentRegistry" auth="Container" |
---|
39 | type="javax.sql.DataSource" driverClassName="org.postgresql.Driver" url="jdbc:postgresql:component_registry" |
---|
40 | username="compreg" password="compreg" maxActive="10" maxIdle="5" maxWait="4000" |
---|
41 | removeAbandoned="false" removeAbandonedTimeout="10" logAbandoned="true" /> |
---|
42 | ... </Context> --> |
---|
43 | |
---|
44 | <!-- To define an ad hoc datasource, use something like the following: --> |
---|
45 | <!-- <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> |
---|
46 | <property name="driverClassName" value="org.postgresql.Driver"/> <property |
---|
47 | name="url" value="jdbc:postgresql:component_registry"/> <property name="username" |
---|
48 | value="compreg"/> <property name="password" value="p4ssw0rd"/> </bean> --> |
---|
49 | |
---|
50 | </beans> |
---|