【www.gdgbn.com--WebService】


1. 设置连接池的读取参数文件
   class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  
   
    WEB-INF/db.properties
   

  

 

2. 连接池

 apache.commons.dbcp.BasicDataSource" destroy-method="close">
       
       
       
        word" value="${jdbc.password}"/>
       
       
       
       
       
       
   

3. 存放的参数文件(db.properties)

# postgresql
#driverClassName=org.postgresql.Driver
#jdbc.url=jdbc:postgresql://127.0.0.1:5432/databaseName

# mysql
#driverClassName=com.mysql.jdbc.Driver
#jdbc.url=jjdbc:mysql://localhost/mytest?useUnicode=true&characterEncoding=utf-8

本文来源:http://www.gdgbn.com/asp/13558/