IBM Support

Sharing a JDBC adapter with one or more modules in an ear file

Question & Answer


Question

How can JDBC adapter be shared among the different modules so that we can have a EAR?

Cause

Sharing JDBC adapter could reduce the size of EAR file.

Answer

If you want to share a JDBC adapter across multiple ear files, see the section about standalone deployment in the WebSphere Adapter for JDBC user guide.

To share a JDBC adapter with one or modules within an ear file by embedded deployment:

1) Go to the Business Integration perspective of WebSphere Integration Developer, and then click File > New > External Service.
2) Select IBM WebSphere Adapter for JDBC and create an Outbound or Inbound service. Ensure that you add the JDBC drivers to the adapter connector project in order to connect to various databases. If you want the JDBC adapter to connect to different databases, you can add all the JDBC drivers to the JDBC adapter connector project at once. The following shows the driver files for Oracle, DB2, and MS SQL server databases.

3) Select the exiting connector project and create another Outbound or Inbound service. The following figure shows the connector “CWYBC_JDBC6.2.0.2.IF02” used to create new outbound or inbound services.


4) Use the same module that you created earlier for the artifacts. In the figures below, the same module "outbound" is used for the Outbound services "OracleOutbound" and "DB2Outbound."





The following figure shows three Outbound services created in the module "outbound".



5) After you create the Inbound or Outbound services, check whether there is only JDBC adapter connector project listed in the J2EE area of Dependencies page for the module "outbound".


Similarly, you can create many Inbound services in a module. The following figure shows three inbound services in the module "inbound".


Note that there is only one JDBC adapter connector project in the J2EE area of Dependencies page for the module "inbound".


You can also create both Inbound and Outbound services with a module. The following figure shows many inbound and outbound services within a module "inbound.outbound".


Note that there is only one JDBC adapter connector project in the J2EE area of Dependencies page for the module “inbound.outbound”.



As shown in the figures above you can see that there is only one JDBC adapter across many modules (“outbound”, “inbound”, “inbound.outbound”). After that, you can export these modules into an ear file, but there is only one JDBC adapter connector project. Thus, by using above steps, you can also accomplish the task how to share one JDBC adapter across multiple modules in an ear file.

[{"Product":{"code":"SSMKUK","label":"WebSphere Adapters Family"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Adapter for JDBC","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"6.2.0.2;6.2.0.1;6.2;6.1;6.0.6;6.0.5;6.0.4;6.0.3;6.0.2.3;6.0.2.2;6.0.2.1;6.0.2;6.0.1;6.0.0.2;6.0.0.1;6.0","Edition":"","Line of Business":{"code":"","label":""}}]

Product Synonym

Websphere JDBC adapter

Document Information

Modified date:
23 June 2018

UID

swg21404234