且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

你如何在 Spring-boot 中自动装配/注入你的数据源?

更新时间:2022-06-08 22:56:57

无论如何都不是 Spring(或 Boot)专家,但是如果属性存在并且有需求,Spring Boot 会自动提供一个 DataSource 类型的 Bean为它.要使用它,您只需 @Autowire 即可.

Not a Spring (or Boot) expert by any means, but Spring Boot will auto-provide a Bean of type DataSource if the properties are there and there's a requirement for it. To use it you just @Autowire it.