DevPortal

How do I configure Java Connectors for J2EE Applications?


Table of Contents


What are Connector Resources?

Connector resources define a set of system-level contracts between the Server and resource adapter.

How do I use Resource Shell to add Java Connector Resources?

To add a Java Connector Resource using the resource shell, on the resourceadmin:> prompt, enter: resourceadmin:> add_jca_cf

There are two ways to add a Connector Resource using add_jca_cf:

Interactive

To use the interactive mode, enter add_jca_cf, and press Enter. This asks for all the required fields one after the other. No special flag is required for this mode.

Enter the following values needed for the command resourceadmin:> add_jca_cf

resourceadmin> - rarName * #abcd.rar
resourceadmin>  - jndiName * #myConnector
resourceadmin>  - user #scott
resourceadmin>  - password #tiger
resourceadmin>  - maxPoolSize [40] #
resourceadmin>  - ConnectionURL [jdbc:oracle:thin:@db1.pramati.com:1521:db1]
#jdbc:oracle:thin:@db1.pramati.com:1521:db1

Note: Fields followed by * are mandatory. Press Enter for the default values. Typing 'q' and pressing Enter at any point cancels the current command.

After this, you are prompted if you want to test the connection factory. The testing is done by trying to establish a connection to the Enterprise Information Server (EIS).

Testing is done on the basis of parameters that you provide while creating a JCA connection factory. Also, the user name and password have to be provided to test the connection factory. If test is false, you will not be prompted for test parameters. A typical output when you set test to true is:

resourceadmin@default>  - test [false] #true
resourceadmin@default>  - testMethodName * #getConnection
resourceadmin@default>  - acceptsConnectionSpec * #true
resourceadmin@default>  - connectionSpecClassName * #com.test.TestConnectionSpec
Pressing only  at the prompt will stop accepting arguments
resourceadmin@default>  - parameterName #debug
resourceadmin@default>  - parameterValue #true
resourceadmin@default>  - parameterName #propertyFile
resourceadmin@default>  - parameterValue #http://localhost:7233/test.cfg
resourceadmin@default>  - parameterName #
resourceadmin@default>  - closeMethodName #close
Successfully Bound Connection Factory [myConnector] for adapter [abcd.rar]
Created JCA ConnectionFactory myConnector successfully
Added JCA Connection Factory [myConnector]

Non-Interactive

To use the non-interactive mode, enter add_jca_cf. All the required attributes - the Resource Archive Name and the JNDI name in this case - have to be specified. All optional attributes have default values that can be modified. Test parameters cannot be specified for this mode.

There are three ways in which you can specify the fields:

How do I use the Console to configure Java Connector Resources?

To configure a JCA Connector Resource on the Console, select Configure > Resources. This displays the Resource screen. If there are Connector Resources added earlier, the Connector Resources section displays the following details:

Table 1: JCA Connector Resource details

FieldsDescription
NameThe JNDI name of the Connection Factory.
Pool UsageThe number of connections taken from the pool.
PropertiesUse Edit to modify and view the existing properties for the Connector Resource.
AddUse Add to add a JCA Connector Resource.
DeleteUse Delete to delete a JCA Connector Resource.

How do I add Java Connector Resources?

Before adding a JCA Connector Resource, ensure that a Resource ARchive (RAR) has been deployed on Server. To add a JCA Connector Resource:

  1. Click Add under the Connector Resources section.
  2. Specify here the following information:

    Table 2: Details for adding a JCA Connector Resource

    FieldsOptionsDescription
    Name-Enter here a unique name with which the Connector Resource will get bound in Server. This is a mandatory field.
    Choose RAR-Select a rar using the drop-down list. This mandatory field displays the deployed .rar files on Server. They are required for adding JCA connectionfactory. The Connector Resource is identified with the name of the resource archive.
    Authorized by-Provides the Authentication required to connect to EIS. The application or container can provide authentication information. The authorization mode can be pre-defined.
    -ApplicationThis field does not require you to supply user name and password. They will be provided by the application while connecting to the Connector Resource.
    -ContainerThis field requires you to supply user name and password at the time of creation.
    --User name: Enter here the user name to connect to EIS.
    --Password: Enter here the password required to authenticate the user name.
    Max Pool Size-Specify the maximum number of connections to be maintained in the connection pool

    Note: All resource archives have the extension .rar. The .rar file must contain a deployment descriptor which should be stored under the name META-INF/ra.xml.

  3. Set the value of the properties on the next page:

    Table 3: Properties for a Java Connector Resource

    FieldsDescription
    ShareableUse this option to indicate whether or not a connection to a resource manager can be shared. The connection resource is shared by default, as in the J2EE environment, transactions are initiated through container-managed or component-managed mechanisms. These mechanisms span across single or multiple component instances.
    PropertiesThis field displays the property name. This is not editable.
    ValueEnter the value of the property in this field.

    Click Save to add the Connector Resource to the database.

How do I edit Java Connector Resources?

After creating a resource, click on the JNDI name in the list of ConnectorResources. The next page displays details of the specific ConnectorResources that you can modify.

Click Save after making the modifications.

How do I delete Java Connector Resources?

Select the Connector Resource to be deleted using the check box on the Resources page and click Delete. This deletes the selected Connector Resource.


Related Topics:

© Pramati Technologies 2007 Runs on Pramati Server | Feedback | Legal