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.
Procedure
-
Browse to the appropriate directory for your
Java version, under
PolicyCenter/admin/lib.
Option Description Java 8 PolicyCenter/admin/lib/java8 Java 11 PolicyCenter/admin/lib/java11 -
Copy the
ojdbc-<version>>.jar
file to the Tomcat lib
directory.
This JAR file contains the APIs for connecting to the PolicyCenter database.
-
Add a
Resourceentry to the context.xml file in the conf directory of the Tomcat instance. If the context.xml file does not exist, create it.The
Resourceelement must be a child of the top-levelContextelement. The resource name must match thedatasource-nameattribute of thejndi-connection-poolelement 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"/> -
Add a
resource-refentry 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> - Restart the Tomcat instance.
