I am working on a Java EE 7
application. I am using Payara micro
to deploy my WAR
files. Now, I need JDBC connectivity in my application, but I need to keep the database IP/username/password somewhere I can change later on, without re-uploading and deploying WAR
file again.
Could anybody please tell me how can I achieve this?
EDIT:
I came accross a solution to that on SO: https://stackoverflow.com/a/6296375/1931698
But, I am looking for a solution without all that plumbing. Inheriting DataSource
just to have connection info in some external file looks like overkill.
EDIT:
Also, it would be really helpful if I can just provide a configuration panel to the user, where he / she can enter JDBC connection info. Is there a way to change that info at runtime (effectively discarding existing connection pool and creating a new one)?