Create a JNDI connection in Apache Tomcat

This section describes the steps to enable Apache Tomcat for JNDI-based database operations, including connection pooling, in CA Strong Authentication.
aa821test
This section describes the steps to enable Apache Tomcat for JNDI-based database operations, including connection pooling, in CA Strong Authentication.
Follow these steps
:
  1. Install Apache Tomcat, and test the installation using the following URL:
    http://localhost:8080/
    The preceding URL must open the Apache Tomcat home page.
  2. Open the server.xml file present in the
    <TOMCAT-HOME>
    /conf directory.
  3. Collect the following information for defining a data source:
    • JNDI Name
      The JNDI name that is used by the product components. This name must match with the AppServerConnectionPoolName.
      N
      in arcotcommon.ini (without the java:comp/env/ prefix).
    • User ID
      The database user ID.
    • Password
      The database password.
    • JDBC Driver Class
      The JDBC driver class name. For example, oracle.jdbc.driver.OracleDriver.
    • JDBC URL
      The JDBC URL for the database server. For example, if you are using Oracle driver, then URL would be: jdbc:oracle:thin:@
      <server>
      :
      <database_port>
      :
      <sid>
      .
  4. Add the following entry to define the datasource within the <
    GlobalNamingResources
    > tag:
    <Resource name="SampleDS"
    auth="Container"
    type="javax.sql.DataSource"
    factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
    username="<
    userid
    >"
    password="<
    password
    >"
    driverClassName="<
    JDBC driver class
    >"
    url="<
    jdbc-url
    >"
    maxWait="30000"
    maxActive="32"
    maxIdle="8"
    initialSize="4"
    timeBetweenEvictionRunsMillis="300000"
    minEvictableIdleTimeMillis="30000"/>
  5. Open the context.xml file present in the
    <TOMCAT-HOME>
    /conf directory.
  6. Add the following entry to define the datasource within the <Context> tag:
    <ResourceLink global="SampleDS" name="SampleDS" type="javax.sql.DataSource"/>
  7. Copy the following database connection pooling (DBCP) dependencies to
    <TOMCAT-HOME>
    /common/
    lib
    directory.
    • commons-dbcp-1.2.2.jar
    • ojdbc14-10.2.0.1.0.jar (for Oracle Database)
    • sqljdbc.jar (Microsoft JDBC driver for Microsoft SQL Server 2005 - version 1.2.2828)