I am new to spring I am trying to create a Database Manager page which shows the database details on page load and updates the database settings when the user press submit
You need to refresh your Application context and get the bean DriverManagerDataSource
again in order to reflect the changes written to propertie files.
context.refresh();
DriverManagerDataSource databaseSource = (DriverManagerDataSource)context.getBean("dataSource");
databaseSource.getUsername();
Tip for getting File object of your resource:
URI a = getClass().getResource("/com/smartcall/bundle/database.properties").toURI();
File file = new File(a);
You will not need to decode the path, i.e. replacing %20 with " ". Referrence