How I can set database connection parameters at startup time jar spring-boot app in console

Viewed 270

I know that it is possible to pass connection parameters as an argument, but I have a requirement - the password from the database must be accepted in hidden mode. For example how System.console().readPassword()

1 Answers

If you are using the latest versions of spring-boot 2.X, the below command line will override your datasource password:

java -jar -Dspring.datasource.password=pass your_jar_file.jar
Related