相关疑难解决方法(0)

如何以编程方式覆盖Spring-boot application.properties

我有来自外部配置web-service的jdbc属性文件在spring boot中为了设置mysql道具,将它们添加到application.properties很容易:

spring.datasource.url=jdbc:mysql://localhost/mydb
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
Run Code Online (Sandbox Code Playgroud)

我怎么能在我的应用程序中重写那些程序?

Spring-batch道具同样如此:

database.driver=com.mysql.jdbc.Driver
database.url=jdbc:mysql://localhost/mydv
database.username=root
database.password=root
Run Code Online (Sandbox Code Playgroud)

spring spring-batch spring-batch-admin spring-boot

43
推荐指数
8
解决办法
5万
查看次数