If your database and Web APIs reside in different servers, you will need to create a database cache so that the Web APIs can connect with the remote database at runtime.
Step 1: In the PowerServer project painter, select the Database page > Advanced tab, click New in the upper part to create the database connection.
Step 2: In the dialog box that displays, specify the settings for the database connection.
The following uses the PB demo database for SQL Anywhere as an example.
-
Select SQL Anywhere (ODBC) from the Provider list.
-
Specify "sales_remotedb" (or any text you like) as the database cache name in the Cache name field.
-
Select the ODBC data source that connects with the remote database.
-
Specify "dba" as the user name and "sql" as the password.
Step 3: Select the option "I have read and agree to the license ...".
Step 4: Click Test connection to make sure the database can be connected successfully.
Step 5: Click OK to save settings and go back to the Advanced tab; and then click New in the lower part to map the transaction object with the database cache.
Step 6: Input "sqlca" as the transaction object that maps to the database cache.
Note
If firewall is turned on in your database server, make sure to configure the firewall to allow the database port number to go through.