Configuring read-only database access for Query Runner

For query results to be returned when testing queries on the Query Runner landing page, you must have configured read-only user credentials for the database. Use the following procedure for configuring read-only user credentials for PegaRULES and PegaDATA databases. If you are using an external database, see Accessing database administration operations on Pega Community for configuration details.

  1. In the context.xml file, add the following resource for accessing the database:
    <Resource 
              name="jdbc/PegaRULESReadOnly"
              auth="Container"
              type="javax.sql.DataSource"
              maxTotal="20"
              maxIdle="10"
              maxWaitMillis="-1"
              driverClassName="org.postgresql.Driver"
              url="jdbc:postgresql://<ip address>:<port>/postgres"
              username="<user name>"
              password="<password>" />

    You can also add the user name and password for the read-only user to the prconfig.xml file instead of the context.xml file.

  2. In the prconfig.xml file, add the following data sources. The value must match the resource name in the context.xml file.
    <env name=database/databases/PegaRULES/datasourceReadOnly" value="java:comp/env/jdbc/PegaRULESReadOnly"/>
    <env name=database/databases/PegaDATA/datasourceReadOnly" value="java:comp/env/jdbc/PegaRULES"/>