Spring_Bean的作用域---和使用外部属性文件

<!-- 使用 bean的scope属性来配置bean的作用域
singleton:默认值.容器初始时创建bean实例,在整个容器的生命周期内只创建这一个bean单例
prototype:原型的,容器初始化时不创建bean的实例,每次请求时都创建新的bean实例,并返回
-->

Spring使用外部属性文件

1,导包

 

user=root
password=password
driverClass=com.mysql.jdbc.Driver
jdbcUrl=jdbc:mysql://localhost:3306/mysql?serverTimezone=GMT%2B8

猜你喜欢

转载自www.cnblogs.com/tanlei-sxs/p/10117231.html