Create an Oracle JNDI data source on Tomcat

About this task

Guidewire bundles the supported version of the Oracle JDBC Thin Driver in the ojdbc-<version>.jar JAR file.

Refer to the following web site for more information about configuring the data source:

Procedure

  1. Browse to the appropriate directory for your Java version, under PolicyCenter/admin/lib.
    OptionDescription
    Java 8 PolicyCenter/admin/lib/java8
    Java 11 PolicyCenter/admin/lib/java11
  2. Copy the ojdbc-<version>>.jar file to the Tomcat lib directory.

    This JAR file contains the APIs for connecting to the PolicyCenter database.

  3. Add a Resource entry to the context.xml file in the conf directory of the Tomcat instance. If the context.xml file does not exist, create it.

    The Resource element must be a child of the top-level Context element. The resource name must match the datasource-name attribute of the jndi-connection-pool element in database-config.xml, for example:

    <Resource name="jdbc/pcDataSource" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
          url="jdbc:oracle:thin:database user/database password@database server name:port/OracleSID"
          username="database user" password="database password" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>
  4. Add a resource-ref entry to the web.xml file in the conf directory of the Tomcat instance.
    For example:
    <resource-ref>
      <description>Oracle Datasource</description>
      <res-ref-name>jdbc/Datasource name</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>
  5. Restart the Tomcat instance.