spring 加载属性配置文件

一、spring配置文件
<!-- 加载属性配置文件 -->
    <context:property-placeholder location="classpath:db.properties"/>
 
二、db.properties
db.driverClassName=com.mysql.cj.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/blog
db.username=root
db.password=password
 

猜你喜欢

转载自www.cnblogs.com/ruowei/p/10852131.html