开发者社区> developerguy> 正文

DataSourceBuilder.create().build()

简介: Spring Boot also provides a utility builder class?DataSourceBuilder?that can be used to create one of the standard data sources (if it is on the classpath).
+关注继续查看

Spring Boot also provides a utility builder class?DataSourceBuilder?that can be used to create one of the standard data sources (if it is on the classpath). The builder can detect the one to use based on what’s available on the classpath. It also auto detects the driver based on the JDBC url.

@Bean
@ConfigurationProperties("app.datasource")
public DataSource dataSource() {
    return DataSourceBuilder.create().build();
}

https://docs.spring.io/spring-boot/docs/1.5.8.RELEASE/reference/htmlsingle/#boot-features-external-config-3rd-party-configuration

?

版权声明:本文内容由便宜云服务器实名注册用户自发贡献,版权归原作者所有,便宜云服务器开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《便宜云服务器开发者社区用户服务协议》和《便宜云服务器开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
No plugin found for prefix ‘doclint‘ in the current project
No plugin found for prefix ‘doclint‘ in the current project
47 0
configure: error: C compiler cannot create executables
configure: error: C compiler cannot create executables
39 0
【build your own xxx】实现你自己的call和apply
【build your own xxx】实现你自己的call和apply
28 0
Maven - Failed to clean project: Failed to delete
Maven - Failed to clean project: Failed to delete
213 0
${project.build.directory}
${project.build.directory}
339 0
+关注
developerguy
A code cleanliness code farmers, A programmer concentrate on elegant design, A want to do with the product architect
文章
问答
视频
文章排行榜
最热
最新
相关电子书
更多
Project Fortis
立即下载
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载


http://www.vxiaotou.com