`

Spring 加载数据源配置文件的两种书写格式

阅读更多

 

 <!-- jdbc属性文件读入 -->

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

        <property name="locations">

            <list>

                <value>classpath:jdbc.properties</value>

            </list>

        </property>

</bean>

    

<context:property-placeholder location="classpath:jdbc.properties" />

为简化PropertyPlaceholderConfigurer的使用,Spring提供了<context:property-placeholder/>元素。

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics