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

 

相关文章
|
7月前
|
Linux iOS开发 MacOS
pnpm全局安装报错:Run “pnpm setup“ to create it automatically, or set the global-bin-dir setting, or the PN
pnpm全局安装报错:Run “pnpm setup“ to create it automatically, or set the global-bin-dir setting, or the PN
2154 0
|
7月前
|
机器学习/深度学习 前端开发 安全
【Gradio】Could not create share link
【Gradio】Could not create share link
2640 6
|
7月前
|
Oracle 关系型数据库 应用服务中间件
Supplemental Readme - Grid Infrastructure Release Update 12.2.0.1.x / 18c /19c (Doc ID 2246888.1)
Supplemental Readme - Grid Infrastructure Release Update 12.2.0.1.x / 18c /19c (Doc ID 2246888.1)
78 7
configure: error: C compiler cannot create executables
configure: error: C compiler cannot create executables
329 0
|
开发工具
Failed to find Build Tools revision 25.0.2
Failed to find Build Tools revision 25.0.2
131 0
No plugin found for prefix ‘doclint‘ in the current project
No plugin found for prefix ‘doclint‘ in the current project
141 0
|
JavaScript 前端开发
【build your own xxx】实现你自己的call和apply
【build your own xxx】实现你自己的call和apply
【build your own xxx】实现你自己的call和apply
|
Java 开发工具
gradle Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.crea
gradle Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().
6790 0
mvn clean package -Dmaven.test.skip=true 报错:[ERROR] Unknown lifecycle phase “.test.skip=true“.
mvn clean package -Dmaven.test.skip=true 报错:[ERROR] Unknown lifecycle phase “.test.skip=true“.
1051 0
mvn clean package -Dmaven.test.skip=true 报错:[ERROR] Unknown lifecycle phase “.test.skip=true“.
|
Java 应用服务中间件 Maven
Maven - Failed to clean project: Failed to delete
Maven - Failed to clean project: Failed to delete
513 0
Maven - Failed to clean project: Failed to delete