Support Article
Cannot connect to external Postgres database
SA-27137
Summary
When trying to connect to an external Postgres database system from a Pega installation on DB2, the test connection always fails.
User has provided the JDBC URL and authentication information correctly, along with placing the appropriate jdbc driver in the Tomcat Lib directory, but still the issue persists.
Error Messages
Problem encountered when getting a database connection: code: 0 SQLState: 08001 Message: No suitable driver found for jdbc:postgresql://your_host:5432/your_database
Steps to Reproduce
1. Create a Database instance and use jdbc url connection method and provide the URL and user/password information.
2. Ensure the jdbc driver is in the class path.
3. Save the record and click Test Connection.
Root Cause
A defect in Pegasystems’ code or rules. When a test connection is performed on a database of a different type than the one hosting Pega, it will always fail until the driver class is loaded by the JVM.
One way to do that is to look up the class in System Management Application under Advance>Web Tier Runtime Environment>Java Class Name.
Resolution
If all the information on the database rule form is correct, it will work during runtime.
Add the driver information in prconfig.xml to address the Test Connection issue as well.
For example:
<env name="database/drivers" value="org.postgresql.Driver" />.
Published August 30, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.