Previous Topic: Application Server Configuration for Database Connection PoolingNext Topic: Enable LDAP Connection Pooling


Enable Database Connection Pooling

This section walks you through the steps to set up database connection pooling on the application server, where you have deployed CA Risk Authentication components.

Apache Tomcat

This section provides the steps to enable Apache Tomcat for JNDI-based database operations.

Follow these steps::

  1. Install the Apache Tomcat application server and test the installation by using the following URL:
    http://localhost:8080/
    
  2. Open the server.xml file present in the <TOMCAT_HOME>/conf/ directory.
  3. Collect the following information required to define a data source:
    JNDI Name

    Specifies the JNDI name used by CA Risk Authentication.

    Important! This name must match with the AppServerConnection PoolName.N in arcotcommon.ini (without the java:comp/env/ prefix).

    User ID

    Specifies the database user ID.

    Password

    Specifies the database password.

    JDBC Driver Class

    Specifies The JDBC driver class name. Example: oracle.jdbc.driver.OracleDriver

    JDBC URL

    Specifies the JDBC URL for the database server. For example if you are using the Oracle driver, then URL will be:

    jdbc:oracle:thin:<server>:<database_port>:<sid>
    
  4. Add the following entry to define the data source 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 available 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. To enable database connection pooling, download the following files from the corresponding third-party source. Then, copy these files to the following directories:
    <TOMCAT_HOME>\common\lib\ folder (on Apache Tomcat 5.x) or 
    
    <TOMCAT_HOME>\lib\ directory (on Apache Tomcat 6.x and 7.x).
    

IBM WebSphere

This section provides the steps to enable IBM WebSphere for JNDI-based database operations.

Follow these steps::

  1. Log in to WebSphere Administration Console.
  2. Select Resources and expand the JDBC node.
  3. Click JDBC Providers.
  4. In the Preferences section, click New to create an appropriate JDBC provider based on the database that you are using.
  5. Perform the following tasks to create the JDBC Provider.

    Note: For more information, refer to following link:
    http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.base.iseries.doc/info/iseries/ae/tdat_ccrtprov.html

  6. Specify the Database Type and Provider Type.
    1. Select Connection pool data source from the Implementation Type drop-down list.
    2. Enter a Name for the JDBC provider. You can also enter a Description for the JDBC Provider.
    3. Click Next.
    4. Enter the absolute path for the JAR file.
    5. Click Next.
    6. After reviewing the summary of the information that you have entered, click Finish to complete the JDBC provider configuration.
  7. Set the CLASSPATH for the JDBC provider that you created in Step 5.
    1. Click Resources and expand the JDBC node.
    2. Click JDBC Providers.
    3. Click the JDBC Provider that you created in Step 5.
    4. Set the Class Path for the JDBC JAR.
    5. Click Apply to save the changes.
  8. Create a Data Source, as follows:
    1. Go to Resources, and then click JDBC.
    2. Under JDBC, open Data Sources and click New. Perform the following steps to create a data source:
    3. Specify the Data source name.
    4. Specify the JNDI name.

      Note: This name must match with the value of AppServerConnection PoolName.N in arcotcommon.ini.

    5. Click Next.
    6. Select an existing JDBC provider created in Step 3.
    7. Click Next.
    8. Depending on the database, enter the following information:
      • For Oracle:

        Specify the Value for JDBC URL. This URL would be of the following type:

           jdbc:oracle:thin:@<server>:<oracle_port>:<sid>
        

        Select the Data store helper class name.

      • For MS SQL Server:
        jdbc:sqlserver://<server>:<sql_port>;databaseName=<databasename>;selectMethod=cursor
        
      • For MySQL:
        jdbc:mysql://<server>:<port-number>/<database>
        
    9. Click Next.
    10. Click Next to view the Summary screen, and then click Finish.
  9. Click the data source created in Step 8.
  10. In the Related Items section, click JAAS - J2C authentication data.
  11. Click New to create a new credential.
  12. Enter login credentials that are used to connect to the database and save the credential.
  13. Click Apply, and then click OK to save the changes made.
  14. Click Data Sources and select the data source that you created in Step 8.
  15. Under Security Settings, Component-managed authentication alias, select the JAAS credential that you created in Step 12 and click Apply, and then OK.
  16. Click Data Sources and select the check box for the data source you created in Step 8.
  17. Click Test connection to verify that you have specified the connection correctly.

Note: This test only checks the connection to the database server, not necessarily the correct definition of the data source.

Oracle WebLogic

This section walks you through the steps to enable Oracle WebLogic for JNDI-based database operations.

Follow these steps::

  1. Log in to WebLogic Administration Console.
  2. Click the Lock & Edit button in the Change Center, if it is not already done.
  3. Navigate to Services, JDBC, and the Data Sources.
  4. Under JDBC, open Data Sources and click New.
  5. Set the following JNDI and the database information:
    1. Set Name = ArcotDB

      Note: This name must match with the value of AppServerConnection PoolName.N in arcotcommon.ini.

    2. Set JNDI Name = ArcotDB
    3. Select the required Database Type, for example Oracle.
    4. Select the required Database Driver, for example Oracle Thin Driver.
  6. Click Next, retain the default values and click Next again.
  7. In the Connection Properties page that appears, set the database connection details. For example, the values for Oracle can be:
  8. Click Next.
  9. Click Test Configuration to verify the database information that you specified.
  10. Click Next and set the preferred data source target server for the WebLogic server instance.
  11. Click Finish.
  12. Click the Activate button in the Change Center to enable the data source settings that you configured in the preceding steps.

JBoss Application Server

This section walks you through the steps to enable JBoss Application Server for JNDI-based database operations.

Follow these steps::

  1. Navigate to the location where you have deployed the WAR files, for example:
    <JBOSS_HOME>\server\default\deploy\
    
  2. Create a data source descriptor file called arcotdatabase-ds.xml.
  3. Collect the following information required to define a data source in the arcotdatabase-ds.xml file:
  4. Open the arcotdatabase-ds.xml in a text editor.
  5. Add the following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <datasources>
    <local-tx-datasource>
    <jndi-name>SampleDS</jndi-name>
    <connection-url><jdbcurl></connection-url>
    <driver-class><JDBC Driver class></driver-class>
    <user-name><database_userid></user-name>
    <password><database_password></password>
    <exception-sorter-class-name><Exception Sorter Class></exception-sorter-class-name>
    </local-tx-datasource>
    </datasources>
    
  6. Save and close the file.