Step 1: Creating a data source and connection pool

You declare a data source to store the Decision Center data.

Before you begin

You must have a database before creating a data source (see Mandatory: Create the databases).

For a list of supported databases, consult the platform support details available on the IBM® support site External link opens a new window or tab.

About this task

To create a data source and a connection pool for Decision Center on Tomcat, you copy the driver for your database to the Tomcat directory, declare the database, and then link the database to the Decision Center archives.

Procedure

  1. Copy your database driver JAR file to the <CATALINA_HOME>/lib directory.
  2. In <CATALINA_HOME>/conf/server.xml, declare the database just before the tag closing the global resources definitions </GlobalNamingResources>. For example:
    <Resource name="jdbc/ilogDataSource" type="javax.sql.DataSource"
        defaultTransactionIsolation="READ_COMMITTED"
        auth="Container"
        username="dcdbUser" password="dcdbUser"
        driverClassName="com.ibm.db2.jcc.DBDriver"
        url="jdbc:db2://db2server:50000/DCDB"/>
  3. Adjust the properties for local transaction data sources:
    defaultTransactionIsolation

    Set the tag defaultTransactionIsolation to READ_COMMITTED to avoid database access problems and hence provide a better concurrency experience.

    username and password

    The tags username="dcdbUser" and password="dcdbUser" are used only to access the database.

    driverClassName

    The class that is used to handle the connections to the database. For example, for Db2®:

    driverClassName="com.ibm.db2.jcc.DBDriver"

    URL

    The url property provides the JDBC connection. For example, for Db2:

    url="jdbc:db2://db2server:50000/DCDB"

    A database named dcdb is created the first time that you access Decision Center.

  4. Link the database to the Decision Center archives by adding the following before the </Host> tag that closes the localhost definition:
    <Context docBase="decisioncenter" path="/decisioncenter" reloadable="false">
        <ResourceLink global="jdbc/ilogDataSource" name="jdbc/ilogDataSource" type="javax.sql.DataSource"/>
    </Context>
    
    <Context docBase="decisioncenter-api" path="/decisioncenter-api" reloadable="false">
        <ResourceLink global="jdbc/ilogDataSource" name="jdbc/ilogDataSource" type="javax.sql.DataSource"/>
    </Context>
    
    
  5. Add UTF-8 encoding to the connector port:
    <Connector URIEncoding="UTF-8" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
  6. Save the file.