I develop a rest WS that will run on AWS BeanStalk.
For the moment, the datasource is configured with property files:
database.driverClass=org.postgresql.Driver
database.jdbcUrl=jdbc:postgresql://localhost:5432/public
database.username=postgres
database.password=postgres
And in context.xml:
<bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${database.driverClass}" />
<property name="jdbcUrl" value="${database.jdbcUrl}"/>
....
But now, I need to have a preprod environnement, using AWS Beanstalk, that expose my system properties like RDS_HOSTNAME, RDS_PORT, RDS_DB_NAME, ...
Is there a way to keep the same system, like writing
database.jdbcUrl=jdbc:postgresql://#{RDS_HOSTNAME}:#{RDS_PORT}/#{RDS_DB_NAME}
In preprod.property?
Or to reset database.jdbcUrl with system property in context.xml?