How to configure external DB connections from Designer Studio
This article is about configuring the external DB connections (using JDBC URL) from Designer Studio, without making any changes in the Application Server.
Ensure the connectivity between Pega App Server and the external DB is allowed. Verify the connectivity from the App Server(Example: telnet <hostname/IP> <port>)
If it is a licensed version DB, then get the corresponding DB driver from the vendor or download the driver, if it is a freeware.
Application needs to be restarted while performing the configuration. So plan a downtime.
1. Create a new DB connection from Records > SysAdmin > Database. In connection method (How to connect option), you can use “configuration in preferences”, if the corresponding data source is already defined in the Application Server (Example: context.xml in tomcat). In such cases, we do not define any such data sources in the Application Server, hence using the JDBC URL option as shown below.
2. Perform a Test Connectivity. We are trying to connect to Postgres DB server over port 5432. The corresponding DB driver is not installed on this PRPC server and therefore, we see the below error.
3. Import the driver file from the Import Wizard
4. The connectivity still fails with the same error message.
5. Though the driver file is imported into DB, it is not specified in the default class path or in the list of default DB drivers. So, create a DSS as given below. The value “org.Postgresql.Driver” is the corresponding class name of postgres DB driver. This needs to be configured based on the DB type we are connecting to.
5. Now, perform the application restart and try testing the connectivity again. This time PRPC is able to connect to the external DB successfully.
Connecting to multiple and different DB’s
We may want to connect to the external DB’s of different type (oracle, MySQL, MS SQL, etc.). In this case, we already have an external DB connection for a postgres DB and going to configure one more DB connection for MySQL DB.
1. Repeat the steps 1 to 4 with the connection parameters of MySQL DB.
2. Modify the existing DSS by adding the class name (semicolon separated) of new DB type which is MySQL.
3. Perform the application restart and test the connectivity.