applicationContext-resources.xml 3.0 KB
<?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:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

    <!-- For mail settings and future properties files -->
    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders" value="true"/>
        <property name="locations">
            <list>
                <value>classpath:jdbc.properties</value>
                <value>classpath:mail.properties</value>
                <value>classpath:hibernate.properties</value>
            </list>
        </property>
        <property name="systemPropertiesMode">
            <util:constant static-field="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
        </property>
    </bean>

    <bean id="dataSource" class="org.apache.commons.dbcp.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}"/>
        <property name="maxActive" value="100"/>
        <property name="maxWait" value="1000"/>
        <property name="poolPreparedStatements" value="true"/>
        <property name="defaultAutoCommit" value="true"/>
        <property name="validationQuery" value="${jdbc.validationQuery}"/>
        <property name="testOnBorrow" value="true"/>
    </bean>

    <bean id="msDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
        <!--<property name="url" value="jdbc:oracle:thin:@szh-ora05.apac.bosch.com:38100:REELDB"/>-->
        <property name="url" value="jdbc:oracle:thin:@//szhorarac03.apac.bosch.com:38000/REELDB.apac.bosch.com"/>
        <property name="username" value="RBAC_ITRAC_USER"/>
        <property name="password" value="ITRAC_user1107"/>
        <property name="maxActive" value="2"/>
        <property name="maxWait" value="1000"/>
        <property name="poolPreparedStatements" value="true"/>
        <property name="defaultAutoCommit" value="true"/>
        <property name="validationQuery" value="select 1 from dual"/>
        <property name="testOnBorrow" value="true"/>
    </bean>

    <!-- 下面定义了DbUtils的一个模板操作Bean -->
    <bean id="dbUtilsTemplate" class="com.myproject.dao.suzhou.DbUtilsTemplate">
        <property name="msDataSource" ref="msDataSource" />
    </bean>

    <!--
    <import resource="mongo.xml"/>
    -->
</beans>