Simon Ritchie wrote:I thought that the contents of a Spring Bean file were never supposed to change
I suspect you have misunderstood the role of a Spring context XML file.
In a non-Spring application:
- you'd usually create a bunch of objects at application startup using "new <class>()" statements
- you'd initialize those objects with values or references to other objects using setter methods
This is exactly what Spring does when it reads a context XML file at startup. It's the same "new" statements and "setMethods" expressed in XML.
After those objects are created, the application context XML does not come into play.
When you set username and password on the DriverManagerDataSource object from login screen, they are set in that object's memory, not in the XML file.
Spring does not modify a context XML file.
When your application terminates, the username and password are lost from memory. On next launch, your user should reenter them.