How to create a database connection available on several environment (Development and Production)

Last modified by Aurelie Bertrand on 2021/08/25 09:51

Create server variables

There will be a variable containing the IP of database server, another containing login and another one with the password.
Those variables are created in the file:
path_to_your_digdahs_install/Enterprise Server/ddentrepriseapi\config\serversetting.xml
Edit the file by replacing the line:
<group category="$uisrv.Advanced" id="serverParams" name="$uisrv.ServerParams">
By:
<group category="$uisrv.Advanced" id="serverParams" name="$uisrv.ServerParams">
<input disabled="false" mandatory="false" name="ip_address_bdd" reg="false" sample="" showif="" src="" text="ip_address_bdd" type="textfield" userparam="false" value="myIP"/>
<input disabled="false" mandatory="false" name="login" reg="false" sample="" showif="" src="" text=" login " type="textfield" userparam="false" value="myLogin"/>
<input disabled="false" mandatory="false" name="password" reg="false" sample="" showif="" src="" text="password" type="textfield" userparam="false" value="myPassword"/>
</group>

Change attributes text and name (in the input tags) by the name of the variable that you want to use, and value by its value

Create database connection

While creating the database connection, fill fields like this:
1596100693452-857.png

Password is hidden but you have to paste: ${server.password}
Edit the identifier of the connection and set the same connection id on every environment (development and production)