Host On-Demand J2EE Connector

Host On-Demand J2EE Connector


Writing Your First Host On-Demand J2EE Connector Application

This section provides an overview of writing a Host On-Demand J2EE Connector application, with code samples showing how to use Host On-Demand J2EE Connector classes.

Overview

To write an application that is managed and deployed in an application server, use the WebSphere Studio Application Developer - Integration Edition (WSAD-IE) tools. WSAD-IE Version 4.1 or later integrates the Host On-Demand J2EE Connector into its development environment, enabling users to easily write J2EE Connector applications. (Users should use WSAD-IE Version 5.0 or later for the Host On-Demand Version 8.0 J2EE Connector.) Please refer to the WSAD-IE documentation for instructions on how to use and write a J2EE Connector application. Once an application is written, it needs to be deployed to an application server. See your application server documentation for detailed instructions on how to deploy application files.

The example below describes how to deploy a Resource Archive (RAR) file on WebSphere Application Server and write simple applications using the J2EE Connector APIs in non-managed and managed environments. These sample applications are found in the ...\toolkit\connector2\samples\ directory.

The sample applications demonstrate a login and logout process that uses screen recognition. Because a user may be connecting to a different server or host and receive different screens than the ones given in the samples, you will need to customize them for your environment.

Non-Obvious Property Information

Here are names, descriptions and values of some of the properties that are not obvious.

In InteractionSpec:

Property Name Description Possible Values
cursorColumn Which column to place the cursor 0 = leave at current position
cursorRecognizeColumn Column cursor position to recognize 0 = ignore
interactionVerb Send, Receive, or Send and Receive 0 = Send
1 = Receive
2 = Send and Receive
keyName An action key (i.e.: ENTER, PF1) Use the following rule: #KEY_NAME (i.e.: #ENTER = ENTER, #PF1 = PF1)
recognizeColumn Starting column position of Strings to recognize integer value within the screen column range
recognizeString String to recognize Some texts
screenDescriptors Screen descriptors A Vector of ECLScreenDesc class
screenName Name of screen Some texts
waitTime Time limit to recognize a screen 0 = no limit

The section below contains some of the property information for ManagedConnectionFactory.

Deploying A Resource Archive (RAR) File

The following procedure shows how to deploy a Resource Archive (RAR) file to a WebSphere Application Server. These instructions are based on WebSphere Application Server Version 4.02.

  1. Start the WebSphere Application Server service and the WebSphere Advanced Administrative Console.
  2. From the Advanced Administrative Console window, select WebSphere Administrative Domain > Resources > J2C Resource Adapters.
  3. Right-click on the J2C Resource Adapters folder and select New.  The J2C Resource Adapter Properties dialog box appears.
  4. Select the General tab and enter a name (such as j2hod) and a description
  5. Select Archive file name and specify the name of one of the RAR files. You can look at the Connections and Advanced tab to see the default values associated with the selected RAR file.
  6. Click OK. After a few moments, the following message appears:
    Command 'J2CResourceAdapter.create' completed successfully." 

    Click OK.

  7. Under J2C Resource Adapters, expand the name that you just used to create (i.e. j2hod).   Right-click J2C Connection Factories and select New.
  8. Under the General tab, enter a name (such as j2hod_cf) for Connection Factory.   Leave the JNDI binding path blank - the tool assigns a default name for the binding path based on the Connection Factory name you specify.
  9. Click on the Advanced tab and fill in the information as necessary.
  10. Click on the Connections tab and fill in the information. If you do not enter a value for a field, a default value is automatically assigned to it. For ScreenSize, enter the correct integer value from the following table:
    Value Size (row x column) Session Type
    2 24 x 80 TN3270, TN5250, VT, CICS
    3 32 x 80 TN3270
    4 43 x 80 TN3270
    5 27 x 132 TN3270, TN5250
    6 24 x 132 VT
    7 36 x 80 VT
    8 36 x 132 VT
    9 48 x 80 VT
    10 48 x 132 VT
    11 72 x 80 VT
    12 72 x 132 VT
    13 144 x 80 VT
    14 144 x 132 VT
    15 25 x 80 VT
    16 25 x 132 VT

    For Security Protocol, use a value from the following table:

    Value Security Protocol
    SESSION_PROTOCOL_TLS TLS
    SESSION_PROTOCOL_SSL SSL
    SESSION_PROTOCOL_TELNET Telnet
    SESSION_PROTOCOL_SSH SSH (VT Only)
    Also, you must set the Security property in the Host On-Demand session properties to true. If you do not do this, then SESSION_PROTOCOL_TELNET will be used as the Security Protocol.
  11. Click OK.  The following message is displayed:
    Command 'J2CConnectionFactory.create' completed successfully. 

    Click OK to continue.

  12. Select the J2C Connection Factories > General tab and get the JNDI binding path (for example, eis/j2hod_cf) for use in the application.
  13. To change the properties of connection factories, right click on the connection factory name and select Properties.
  14. Stop and re-start the application server.

See the WebSphere Application Server library for more information on using this product.


[ Top of Page | Previous Page | Next Page | Table of Contents ]