What is the best way to configure Datasources if application server may change client to client?
I have originally specified it in the application server itself. But now application servers are changing client to client. Clients are using many different application servers as JBOSS,Tomcat or Websphere etc.
Now it is becoming tedious for me as now it has to be configured as per the client specific server and I have to understand their application server configuartion.
That is why now I am moving datasource configuration to Spring’s application context.
- What is most efficient way to inject datasource configuration while dealing with multiple application servers?
I prefer configuring the database connection on the application level.
A good way to achieve this would be to define the relevant connection settings in a properties file located outside you web application, eg “/home/myuser/mywebapp/database.properties”. You can then configure your spring application to read the properties from this file and create your datasource accordingly.
This way you can