hansongjiang
 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:p="http://www.springframework.org/schema/p"
 5        xsi:schemaLocation="
 6         http://www.springframework.org/schema/beans 
 7         http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 8 <!-- 使用spring提供的PropertyPlaceholderConfigurer读取数据库配置信息.properties -->
 9     <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
10         <property name="locations">
11             <list>
12                 <!--
13                     这里的classpath可以认为是项目中的src-属性名是 locations,
14                     使用子标签<list></list>可以指定多个数据库的配置文件,这里指定了一个
15                 -->
16                 <value>classpath:resource/config/jdbc.properties</value>
17             </list>
18         </property>
19     </bean>
20 </beans>

 

分类:

技术点:

相关文章:

  • 2021-09-19
  • 2021-09-19
  • 2021-11-28
  • 2022-01-02
  • 2021-08-01
  • 2021-12-11
  • 2019-05-20
猜你喜欢
  • 2021-12-05
  • 2021-12-28
  • 2021-12-28
  • 2021-12-05
  • 2021-09-19
  • 2021-11-20
  • 2021-11-11
相关资源
相似解决方案