两种方法:
-----------------------------------1----------------------------
<!-- 加载链接数据库属性文件 --> <context:property-placeholder location="classpath:dataSource-configer.properties" />
-----------------------------------2----------------------------
<bean id="joinCDB" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>classpath:jdbc.properties</value> </property> </bean>
(实例参考上面spring配置)
时间: 2024-10-10 05:39:00