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:
- To make the EAR file updates, import the EAR file into the IBM® Assembly and Deploy Tools for WebSphere® Administration.
- Expand the FTM_WEB project and double-click the Deployment Descriptor:FTM entry to open it in the deployment descriptor editor.
- Select the References tab and click Add....
- 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
- Save the changes, select the FTM Project, right-click, and export the EAR file.
- 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:
- Import the EAR file into the IBM Assembly and Deploy Tools for WebSphere Administration as in the previous step.
- Expand the FTM_WEB project and double-click the Deployment Descriptor:FTM entry to open it in the deployment descriptor editor.
- Select the Source tab.
- Find the <env-entry-name>dbDataConnections</env-entry-name> entry and edit its value.
To update the dbDataConnections environment entry after deployment:
- After the OAC EAR is deployed by using the WebSphere Integrated Solutions Console, go to the Applications menu.
- In the list of enterprise applications, select the FTM EAR application.
- 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:
If you have an entry at the application level:jms/ftmqcf/FTM Sample App/1.0.0
This takes priority and then, ultimately, the root level:jms/ftmqcf/FTM Sample App
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. - 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:
If you have an entry at the application level:jms/ftmq/FTM Sample App/1.0.0
jms/ftmq/FTM Sample App
then this takes priority and then, ultimately, the root level overrides all entries if present:
If none of these entries are found, an error is displayed in the console when attempting to send a message.jms/ftmq