Step 2: Creating a data source and connection pool

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

Before you begin

You must have a database to create a data source.

Note: Beginners who use the Derby embedded database can create the database as part of this procedure.

For a list of supported databases, see IBM® Support site.

Procedure

  1. Register the JDBC driver as a core module.
    1. Under the <JBOSS_HOME>/modules directory, create a file path structure. For example, for a Derby driver, create the following structure: <JBOSS_HOME>/modules/org/apache/derby/main
    2. Copy the JDBC driver derby.jar file into the main subdirectory.
    3. In the main subdirectory, create a module.xml file. Example for Derby:
      <module xmlns="urn:jboss:module:1.0" name="org.apache.derby">
          <resources>
              <resource-root path="derby.jar"/>
              <!-- Insert resources here -->
          </resources>
          <dependencies>
              <module name="javax.api"/>
          </dependencies>
      </module>
    4. Launch the JBoss server and run the jboss-cli command to register the new module in the server. The command is available in <JBOSS_HOME>/bin. It must be executed with the name of the new module as follows:./jboss-cli[.sh|.bat] --connect "/subsystem=datasources/jdbc-driver=derby:add(driver-name=derby,driver-module-name=org.apache.derby)"
  2. Create the data source.
    1. Log in to the JBoss Management Console. By default, http://localhost:9990/console.
    2. Click the Configuration tab.
    3. Under Subsystems, select Connector > Datasources
    4. Click the Datasources panel.
    5. Click Add, and then enter a name (for example, DCdatasource) and a JNDI name (java:/jdbc/ilogDataSource) as the data source attributes.
    6. Select the JDBC driver to be used for the new data source. The JDBC driver registered as a core module in step 1 should appear here.
  3. Specify the connection settings.
    Connection URL

    This setting defines the JDBC connection URL. For example: jdbc:derby:c:/dcdb;create=true

    User name and Password

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

    Tip: If the transaction isolation level is not set to READ-COMMITTED, you might encounter database access problems. Configure data source isolation to provide a better concurrency experience.
  4. Select the new data source in the table and then click Enable and then Confirm.