SpringBoot引入外部xml配置方式(二)

1、jdbc.properties关于数据库连接池配置信息将src/main/resources中的jdbc.properties,重新命名为application.properties。这样系统会在项目启动时默认加载application.properties配置2、属性类对应applicatio


SpringBoot引入外部xml配置方式(一)

解读:@Configuration:声明我们JdbcConfig是一个xml配置类@PropertySource:指定属性文件的路径是: classpath: jdbc. properties@Value:通过@Value为属性注入值@Bean:通过@Bean将dataSource() 方法声明为一


SpringBoot入门

maven中的POM文件,默认配置继承父项目中的jar包等依赖<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-star