properties模板

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssmdemo1?useSSL=true&useUnicode=true&characterEncoding=UTF-8
jdbc.username=root
jdbc.passworld=123456



<!--扫描db.properties文件-->
<context:property-placeholder location="classpath:db.properties"/>

<!--Druid连接池-->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.passworld}"/>
</bean>
原文地址:https://www.cnblogs.com/m987/p/12922124.html