iSeries Connectivity

JCA Adaptors

Tech Note

Document Location

This document is only valid on the day it was printed.

The source of the document will be found on the project's PC in location:

Revision History

Date / Summary of Changes / Changes marked
18/10/06 / First Draft

Approvals

This document requires the following approvals.

Signed approval forms are filed in the Specialist section of the project files.

Name / Signature / Title / Date of Issue / Version

Distribution

This document has been distributed to

Name / Title / Date of Issue / Version / Reviewed

Sign Off

This document has been distributed to

Name / Title / Date of Sign Off / Signature / Version

Table Of Contents

1Introduction......

2General Procedure......

3RAD (WDSCi) Configuration......

3.1Import RAR file......

3.2Create J2C Resource Adaptor......

3.3Create JAAS Alias......

3.4Create Connection Factory......

3.5Configure Connection Factory......

3.6RPG Wizard......

4WebSphere Configuration......

4.1Import RAR file and Create Resource Adaptor......

4.2Create JAAS Alias......

4.3Create Connection Factory......

4.4Configure Connection Factory......

1Introduction

There are four main methods of connecting a WebSphere based application to an iSeries based RPG program:-

  • Stored procedure – utilise JDBC from WebSphere to call a Stored Procedure, which in turn executes the RPG program.
  • Program Call Interface – low level Java API to call RPG program;
  • PCML – simplifies Program Call Interface interface through the use of an XML based PCML (Program Call Markup Language) configuration file.
  • J2C/JCA Resource Adaptor – enhances underlying connection mechanism to use connection pooling for better resource management.

This Technical Note specifically examines the use of Resource Adaptor to provide a JCA compliant means of application connectivity. In particular this approach enables the use of JAAS (Java Authentication and Authorisation Service) aliases to encapsulate login credentials, and allows the WebSphere Admin Console to be used to configure the use of connection pooling.

2General Procedure

The following steps define the general process that must be adopted to implement a Resource Adaptor based approach. Subsequent sections cover specific configuration activities that must be conducted within a RAD based development environment, or a stand alone WAS server.

The following activities must be completed in order to fully install, define and configure a J2C Resource Adaptor based approach:-

  • Import Resource Archive (RAR) file into server – this installs the Resource Adaptor (which may be provided by IBM, or a third party), into the WebSphere Application Server, effectively extending its integration capabilities;
  • Create Resource Adaptor from RAR – once the
  • Create JAAS Alias to iSeries
  • Create Connection Factory, defining the required properties;
  • Configure connection properties

3RAD (WDSCi) Configuration

It is possible to perform these configuration tasks from within RAD (WDSCi), without requiring access to the WebSphere admin console. This is made possible by utilising the Enhanced EAR feature of RAD, which enables server configuration information to be specified within the EAR’s application.xml file. This information is then used to configure the server when the application is deployed. Configuration details defined in this way are said to only have ‘application scope’ and hence cannot be viewed within the WAS admin console, as it only provides views at Server, Node and Cell levels. Therefore this method of server configuration should be viewed as an initial step to verify the adaptor based connectivity.

3.1Import RAR file

To install the RAR, the following steps must be undertaken:-

  • Import RAR file – browse to \Program Files\IBM\Rational\SDP\6.0\radi_prod\eclipse\plugins\com.ibm.etools.iseries.webtools.ae_version/lib/iseriespgmcall.rar.

This will create the iseriespgmcall and iseriespgmcallEAR projects, that will be used to define the resource adaptor settings within the enhanced EAR file.

3.2Create J2C Resource Adaptor

Once the adaptor archive has been installed, we can now create the adaptor itself be following the steps below:-

  • Double click the application.xml file within the generated EAR project, and select the Deployment tab;
  • Expand the J2C External Options section;
  • Select add under J2C Resource Adaptors;
  • The resulting dialog should be pre-populated with the previous imported resource adaptor;
  • Select OK to create the adaptor.

3.3Create JAAS Alias

This encapsulates the authentication credentials used by the adaptor to connect to the iSeries:-

  • Again double click the application.xml file within the generated EAR project, and select the Deployment tab;
  • Expand the Authentication section;
  • Create an appropriate Authentication Aliss, supplying the appropriate user if and password for the relevant iSeries host.

3.4Create Connection Factory

This will create the underlying factory object used by the server infrastructure to establish connections:-

  • Double click the application.xml file within the generated EAR project, and select the Deployment tab;
  • Expand the J2C External Options section;
  • Under J2C Connection Factories, select Add;
  • Configure the adaptor as required, specifying an appropriate JNDI name,;
  • The JAAS alias created in the previous section should be used for both container and component managed authentication alias.

3.5Configure Connection Factory

Under the J2C External Options section, create the following Resource Properties:-

  • Server name – this is the name (or IP address) of the iSeries host to be contacted;
  • Username – this parameter may be left empty if a JAAS alias has been configured;
  • Password - this parameter may be left empty if a JAAS alias has been configured.

The External J2C Options section should now look similar to the screen below;-

Figure 1 - J2C Options

3.6RPG Wizard

When utilising the RPG program call bean wizard, this J2C Connection may be specified (through its JNDI name) and will be subsequently used by wizard generated code when creating server connections.

4WebSphere Configuration

The process to configure an external WebSphere Application Server follows a similar path, with all tasks conducted through the Admin console.

4.1Import RAR file and Create Resource Adaptor

To install the Adaptor we must:-

  • Select Resources -> Resource Adaptors;
  • Select the appropriate scope for the resource adaptor (and click apply);
  • Import the RAR file that contains the adaptor - browse to \Program Files\IBM\Rational\SDP\6.0\radi_prod\eclipse\plugins\com.ibm.etools.iseries.webtools.ae_version/lib/iseriespgmcall.rar;
  • Specify the archive and classpaths of the connector module, which in this case is:-
  • D:\dev\WDSCiAE\Budget\JCA\iseriespgmcall\connectorModule\jt400.jar\
  • D:\dev\WDSCiAE\Budget\JCA\iseriespgmcall\connectorModule\pgmcallrt.jar\
  • D:\dev\WDSCiAE\Budget\JCA\iseriespgmcall\connectorModule\

Each entry in the classpath should appear on a separate line. Note that the variable {$CONNECTOR_INSTALL_ROUTE} can be used to loose code the path.

4.2Create JAAS Alias

This encapsulates the authentication credentials used by the adaptor to connect to the iSeries. Select Security -> Global Security -> JAAS Configuration -> J2C Authentication Data. Create a new alias, containing a valid user id and password to the target iSeries host.

4.3Create Connection Factory

This will create the underlying factory object used by the server infrastructure to establish connections:-

  • Select Resources -> Resource Adaptors -> {the iSeries adaptor created in section 4.1};
  • Select J2C Connection Factory;
  • Create a new Connection Factory, specifying an appropriate JNDI name;
  • Use the JAAS alias created in the previous section for both container and component managed authentication alias.
  • Select OK and Save the changes;

4.4Configure Connection Factory

Select the Connection Factory previously created and choose the “Connection Pool Properties” option. From here the various connection pool parameters may be set as required, as shown below in Figure 2:-

Figure 2 - Connection Configuration

Similarly choose the “Custom Properties” option to provide connection details, as shown below

Figure 3 - Connection Custom Properties

If the username and password are specified here, they will override those defined within the JAAS alias that was previously associated with the Connection Factory.

Page 1 of 13

D:\Specialist Products\CM\Campaigner Application\Technical Specifications\WMQ Configuration Tech Note.doc 11 December 2018

Company Confidential