码迷,mamicode.com
首页 > 其他好文 > 详细

DataSourceBuilder.create().build()

时间:2017-11-12 21:51:47      阅读:503      评论:0      收藏:0      [点我收藏+]

标签:list   stand   code   util   build   jdb   pre   word   ring   

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

 

DataSourceBuilder.create().build()

标签:list   stand   code   util   build   jdb   pre   word   ring   

原文地址:http://www.cnblogs.com/softidea/p/7822891.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!