1、db.properties中的配置文件:
jdbc.jdbcUrl=jdbc:mysql://127.0.0.1:3306/test01?useUnicode=true&characterEncoding=utf8
jdbc.driverClass=com.mysql.jdbc.Driverjdbc.user=root
jdbc.password=1234
jdbc.maxPoolSize=100
jdbc.minPoolSize=30
jdbc.initialPoolSize=30
jdbc.maxIdleTime=20
2、*.xml加载properties的配置文件
<context:property-placeholder location="classpath:db.properties"/>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="jdbcUrl" value="${jdbc.jdbcUrl}" />
<property name="driverClass" value="${jdbc.driverClass}" />
&