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

 

相关文章
|
11月前
No plugin found for prefix ‘doclint‘ in the current project
No plugin found for prefix ‘doclint‘ in the current project
83 0
|
11月前
|
开发工具
Failed to find Build Tools revision 25.0.2
Failed to find Build Tools revision 25.0.2
62 0
|
11月前
configure: error: C compiler cannot create executables
configure: error: C compiler cannot create executables
82 0
|
JavaScript 前端开发
【build your own xxx】实现你自己的call和apply
【build your own xxx】实现你自己的call和apply
【build your own xxx】实现你自己的call和apply
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“.
640 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
305 0
Maven - Failed to clean project: Failed to delete
|
开发工具 Android开发
Failed to find Build Tools revision 28.0.3
Failed to find Build Tools revision 28.0.3
187 0
Failed to find Build Tools revision 28.0.3
|
Java 测试技术 Maven
${project.build.directory}
${project.build.directory}
${project.build.directory}
|
Android开发
Import project出现Select at least one project的解决方法
Import project出现Select at least one project的解决方法
Import project出现Select at least one project的解决方法
|
前端开发 PHP 区块链