I am using the below Java statement to start the PostgreSQL server from Java code. I am using Runtime.getRuntime().exec()
method to achieve this.
final Process startServer = Runtime.getRuntime().exec("PostgreQL -D data/dir/ start");
Here when the server is SSL enabled and if the key is password protected, in command line it prompts for password (see below lines). In this case how can I pass the password.
Is server running?
starting server anyway
waiting for server to start......Enter PEM pass phrase:....
Do we have any option to pass the password as a parameter, when prompted? or in PostgreSQL while starting do we have any provision to pass the keypassword (like PostgreSQL -d data/dir/ -keyPass password start
)?