Spring配置dbcp

来源:互联网 发布:uml软件建模技术 编辑:程序博客网 时间:2024/05/29 15:10
  <bean id="propertyConfig"  class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">  <property name="location" value="/jdbc.properties" /> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"  destroy-method="close">  <property name="driverClassName" value="${jdbc.driverClassName}" />  <property name="url" value="${jdbc.url}" />  <property name="username" value="${jdbc.username}" />  <property name="password" value="${jdbc.password}" /> </bean> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">  <property name="dataSource" ref="dataSource" /> </bean>


 

原创粉丝点击