How to resolve a Cannot load JDBC driver error - 10.x

Symptoms

One or more SQL macros return the following error:

org.apache.tomcat.dbcp.dbcp.SQLNestedException:
Cannot load JDBC driver class
Unable to load database driver: org.postgresql.Driver. Make sure your configuration is correct.
Unable to load database driver: net.sourceforge.jtds.jdbc.Driver

Cause

The data source is unable to locate your JDBC driver, and therefore, cannot connect to the specified database.

Resolution

Verify the following:

  • Application server: JDBC driver must be installed in a location that is on the classpath of your application server. For standalone installations, the location is <install-directory>/lib.
  • Profile: dbJar must point to the correct location of the JDBC jar file. Try absolute address if relative address does not work, especially for Windows.