⽤properties⽂件读取数据库的配置⽂件当properties⽂件在src⽬录下时以下三种路径都是正确的。(经过实验验证都可以读到配置⽂件),classpath不需要⼤写字母
<bean id="property"
class="org.springframework.fig.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:jdbc.properties</value>
</property>
</bean>
<bean id="property"
class="org.springframework.fig.PropertyPlaceholderConfigurer">
<property name="locations">
<value>jdbc.properties</value>
</property>
许嵩的女朋友徐佳颖
</bean>
<bean id="property"
class="org.springframework.fig.PropertyPlaceholderConfigurer">
<property name="locations">
<value>/jdbc.properties</value>
</property>
</bean>
欧莱雅化妆品推荐Spring中读取配置⽂件properties
李若彤演过的电视剧<bean id="propertyConfigurer" class="org.springframework.fig.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:jdbc.properties</value>
</property>
社会很单纯复杂的是人是什么歌</bean>
<bean id="dataSource" destroy-method="close" class="org.apachemons.dbcp.BasicDataSource">读取配置文件失败
<property name="driverClassName">
<value>${jdbc.driverClassName}</value>   ${键值}
</property>
<property name="url">
<value>${jdbc.url}</value>
</property>
<property name="username">
<value>${jdbc.username}</value>
</property>
手机祝福短信<property name="password">
<value>${jdbc.password}</value>
</property>
</bean>