Create a SQL Server JNDI data source on Tomcat

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 mssql-jdbc-<version>.jar 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 attribute 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="com.microsoft.sqlserver.jdbc.SQLServerDriver"
          url="jdbc:sqlserver://database server name:database server port;selectMethod=direct;
          databaseName=database name;sendStringParametersAsUnicode=false;user=database user;
          password=database password"
          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>SQL Server 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.