1

My application is using PostgreSQL as database. The organizational security policy requires the password to be changed each month. For application server, the database password is stored encrypted in a properties file. Has anybody worked for such a requirement to get the database password in the java application server refreshed with the new password, when the DBA changes the DB password. The application server cannot be re-started.

  • DataSources generally are administered outside the web application in the web container/application server. – Joop Eggen Apr 13 '16 at 11:44
  • Maybe you should have a look at this answer:http://stackoverflow.com/questions/13248066/how-to-reload-properties-with-spring – Koustav Ray Apr 13 '16 at 12:27

2 Answers2

0

Let the application server provide the datasource .

You should define your datasource from your application server's administration interface and access it in your application through JNDI.

The application server will most likely handle the password encryption himself, possibly in a configurable way so to respect your security standards, and will let you change it at runtime.

Aaron
  • 24,009
  • 2
  • 33
  • 57
0

This is more like what you would want to do.. http://howtodoinjava.com/java-7/auto-reload-of-configuration-when-any-change-happen/

Koustav Ray
  • 1,112
  • 13
  • 26