Advertisement
Guest User

jdbc-context

a guest
Jul 31st, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.90 KB | None | 0 0
  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"
  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/context
  9.       http://www.springframework.org/schema/context/spring-context.xsd">
  10.  
  11.     <bean abstract="true" id="commonPropertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  12.         <property name="locations">
  13.             <list>
  14.                 <value>classpath:prop/common.properties</value>
  15.             </list>
  16.         </property>
  17.     </bean>
  18.  
  19.     <!--<context:property-placeholder location="classpath:prop/*.properties" order="1" />-->
  20.  
  21.     <bean id="baseDataSource" abstract="true"
  22.          class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
  23.         <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" />
  24.         <property name="username" value="${dbUser}" />
  25.         <property name="password" value="${dbPassword}" />
  26.         <property name="initialSize" value="5" />
  27.         <property name="maxActive" value="10" />
  28.         <property name="testOnBorrow" value="true"/>
  29.         <property name="validationQuery" value="select 1"/>
  30.     </bean>
  31.  
  32.     <bean id="dataSourcePortal" parent="baseDataSource">
  33.         <property name="url" value="jdbc:jtds:sqlserver://${dbServer}/${dbName}" />
  34.     </bean>
  35.  
  36.     <bean id="dataSourceSys" parent="baseDataSource">
  37.         <property name="url" value="jdbc:jtds:sqlserver://${dbServer}/${dbNameSys}" />
  38.     </bean>
  39.  
  40.     <beans profile="dev" >
  41.         <bean parent="commonPropertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  42.             <property name="locations">
  43.                 <list merge="true">
  44.                     <value>classpath:prop/dev.properties</value>
  45.                 </list>
  46.             </property>
  47.         </bean>
  48.     </beans>
  49.  
  50.     <beans profile="test">
  51.         <bean parent="commonPropertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  52.             <property name="locations">
  53.                 <list merge="true">
  54.                     <value>classpath:prop/test.properties</value>
  55.                 </list>
  56.             </property>
  57.         </bean>
  58.     </beans>
  59.  
  60.     <beans profile="prod">
  61.         <bean parent="commonPropertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  62.             <property name="locations">
  63.                 <list merge="true">
  64.                     <value>classpath:prop/prod.properties</value>
  65.                 </list>
  66.             </property>
  67.         </bean>
  68.     </beans>
  69. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement