NiyazAkh
NiyazAkh

Reputation: 21

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

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()

Upvotes: 2

Views: 795

Answers (1)

Axiomatic-1
Axiomatic-1

Reputation: 61

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

Upvotes: 3

Related Questions