I’ve deployed a web-module which connects to the database via a datasource configured in the Java EE application server.
Currently, the user/password for the database connection is set in the proper Java EE application server’s datasources configuration file.
I want to change during runtime the datasource’s user/password. (e.g.: implement a new web form in which the user is asked to enter de user/password to be used in the database connection).
Is there a standard way to do that in Java EE applications or it depends on the Java EE application server? In this case I’m using Orion application server.
DataSource has a getConnection method that takes a username and password. That seems to be what you are looking for.