2

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 Answer 1

3

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
Sign up to request clarification or add additional context in comments.

2 Comments

yes, but the password will be entered as plain text, I am looking for a way to enter the password in hidden mode
@NiyazAkh when you say as in hidden mode do you actually mean to be able to run your Spring Boot application via terminal by prompting user to enter DB password before running app or by providing some Secret value from a file (e.g. .env)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.