Step 2: Creating a data source and connection pool

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

Before you begin

You must have a database to create a data source.

For a list of supported databases, consult the platform support details available on the IBM support site.

About this task

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

Procedure

  1. Copy the database driver to a directory of your choice, that you must specify in the server.xml file when you declare the data source. For example, the Derby embedded database driver is derby.jar, which is available in <InstallDir>/shared/tools/derby/lib. Copy the driver to the <WLP_HOME>/usr/shared/resources/derby directory for example.
  2. Open <WLP_HOME>/usr/servers/<SERVER_NAME>/server.xml.
  3. Declare the data source by updating the server.xml file as follows:
    <!-- Decision Center data source --> 
    <jdbcDriver id="DerbyJdbcDriver" libraryRef="DerbyLib"/>
    <library id="DerbyLib" filesetRef="DerbyFileset"/>
    <fileset id="DerbyFileset" dir="${shared.resource.dir}/derby" includes="derby.jar"/>
    <dataSource id="derbyEmbedded" isolationLevel="TRANSACTION_READ_COMMITTED" jndiName="jdbc/ilogDataSource" jdbcDriverRef="DerbyJdbcDriver">
        <properties.derby.embedded
            databaseName="${server.config.dir}/derby/dcdb"
            createDatabase="create"
            user="dcdbUser"
            password="dcdbUser"/>
    </dataSource>
  4. Adjust the properties for local transaction data sources:
    driver path

    The <fileset> tag specifies the path to the driver that is used to handle the connections to the database. For example, for the Derby embedded database.

    isolationLevel

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

    username and password

    The properties user="dcdbUser" and password="dcdbUser" are only used to access the database.

    database name

    The property databaseName="${server.config.dir}/derby/dcdb" provides the JDBC connection.

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

  5. Save the file.