To be independent of the underlying Database, I was using Apache DBCP2 as a datasource and while loading the datasource I was using either a file containing the connection properties or loading them from the environment.