`

spring application.xml中加载配置文件

 
阅读更多

application.xml同级目录constant.properties

 

<bean id="propertyPlaceHolderConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
        <property name="ignoreResourceNotFound" value="true" />
        <property name="locations">
            <list>
                <value>classpath:constant.properties</value>
            </list>
        </property>
    </bean>
   
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
        destroy-method="close">
        <property name="driverClass" value="${jdbc.driverClassName}" />
        <property name="jdbcUrl" value="${jdbc.url}" />
        <property name="user" value="${jdbc.username}" />
        <property name="password" value="${jdbc.password}" />
        <property name="preferredTestQuery" value="select 1" />
        <property name="testConnectionOnCheckout" value="true" />
        <property name="maxPoolSize" value="1" />
    </bean>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics