Configuring the database connections

The OAC supports connections to multiple databases. The OAC EAR file is delivered with a single, pre-configured JDBC resource reference. For more information, see Install the Enterprise ARchive (EAR) file.

To configure additional database connections, use the following steps:

Summary:
  • Update the OAC EAR file to add more JDBC resource references.
  • After deployment, update the dbDataConnections environment entry for the OAC web module.
To update the EAR file:
  1. To make the EAR file updates, import the EAR file into the IBM® Assembly and Deploy Tools for WebSphere® Administration.
  2. Expand the FTM_WEB project and double-click the Deployment Descriptor:FTM entry to open it in the deployment descriptor editor.
  3. Select the References tab and click Add....
  4. Select Resource reference, click Next, and enter the following information:
    • Name: <add the name for your resource reference here>. For example, jdbc/ftmResourceRef_002
    • Type: javax.sql.DataSource
    • Authentication: Container
    • Sharing scope: Sharable
  5. Save the changes, select the FTM Project, right-click, and export the EAR file.
  6. When the EAR is deployed, you are prompted to map each resource reference to an existing JDBC data source and specify the authentication details.
To update the dbDataConnections environment entry in the EAR file:
  1. Import the EAR file into the IBM Assembly and Deploy Tools for WebSphere Administration as in the previous step.
  2. Expand the FTM_WEB project and double-click the Deployment Descriptor:FTM entry to open it in the deployment descriptor editor.
  3. Select the Source tab.
  4. Find the <env-entry-name>dbDataConnections</env-entry-name> entry and edit its value.
To update the dbDataConnections environment entry after deployment:
  1. After the OAC EAR is deployed by using the WebSphere Integrated Solutions Console, go to the Applications menu.
  2. In the list of enterprise applications, select the FTM EAR application.
  3. Click the Environment entries for web modules link. On this window, you can change the contents of the dbDataConnections environment entry. For an explanation of the remaining entries on this window, see Environment entries and resources.

The contents of the dbDataConnections environment entry is an XML snippet and is expected to be in the following format (displayed here on separate lines for clarity). This example shows two configured database connections.

Note: A corresponding DBConnection node must be configured for each resource reference that is configured in the OAC EAR file.
<DBConnections>
  <DBConnection name="FTM Dev1" shortName="FTM1" jndiName="java:comp/env/jdbc/ftmResourceRef_001" schema="FTM" jndiQCF="jms/ftmqcf1" jndiQ="jms/ftmq1"/>
  <DBConnection name="FTM Dev2" shortName="FTM2" jndiName="java:comp/env/<your new resource reference name for connection 2>" schema="FTM" jndiQCF="jms/ftmqcf2" jndiQ="jms/ftmq2"/>
</DBConnections>

DBConnection attributes:

name
A descriptive name for the database connection (this name appears on the OAC Preferences page).
shortName
This name appears in the instance column, which is displayed on most pages that show retrieved data in tabular format.
jndiName
The JNDI name for the JDBC resource reference that is configured in the OAC EAR file. For example: java:comp/env/comp/env/jdbc/ftmResourceRef_001
schema
The database schema.
jndiQCF
The JNDI name prefix of the JMS queue connection factory (QCF). This is the root and, if this JMS QCF entry is present for FTM in the application server resources, this JMS entry applies to all applications. If only one queue manager is used for all applications, a single root QCF entry is sufficient. Alternatively, each application and application version can have its own QCF by appending the application name and, optionally, the version name to the root. The default root is jms/ftmqcf and so, for each application, the OAC ultimately looks for a resource in WebSphere Application Server with a JNDI name of jms/ftmqcf/Your App Name/Your App Version, for example:
jms/ftmqcf/FTM Sample App/1.0.0
If you have an entry at the application level:
jms/ftmqcf/FTM Sample App
This takes priority and then, ultimately, the root level: jms/ftmqcf overrides all entries. If none of these entries are found, an error is displayed in the console when attempting to send a message.
For more information about how to configure the JMS queue connection factory, see Configuring WebSphere MQ components.
jndiQ
Queue JNDI name prefix: The same logic applies to the queue as for the QCF except that it is required to define JMS queues at the application or application version level for a multiple application setup. The default root is jms/ftmq and so, for each application, the OAC ultimately looks for a resource in the application server with a JNDI name of jms/ftmq/Your App Name/Your App Version, for example:
jms/ftmq/FTM Sample App/1.0.0
If you have an entry at the application level: jms/ftmq/FTM Sample App then this takes priority and then, ultimately, the root level overrides all entries if present:
jms/ftmq
If none of these entries are found, an error is displayed in the console when attempting to send a message.
For more information about how to configure the JMS queue, see Configuring WebSphere MQ components.