![]() |
|
Connector resources define a set of system-level contracts between the Server and resource adapter.
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:
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 onlyat 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]
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:
add_jca_cf rarName= abcd.rar jndiName=myConnectoradd_jca_cf abcd.rar myConnectoradd_jca_cf -rarName abcd.rar -jndiName myConnectorTo 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
| Fields | Description |
|---|---|
| Name | The JNDI name of the Connection Factory. |
| Pool Usage | The number of connections taken from the pool. |
| Properties | Use Edit to modify and view the existing properties for the Connector Resource. |
| Add | Use Add to add a JCA Connector Resource. |
| Delete | Use Delete to delete a JCA Connector Resource. |
Before adding a JCA Connector Resource, ensure that a Resource ARchive (RAR) has been deployed on Server. To add a JCA Connector Resource:
Table 2: Details for adding a JCA Connector Resource
| Fields | Options | Description |
|---|---|---|
| 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. |
| - | Application | This field does not require you to supply user name and password. They will be provided by the application while connecting to the Connector Resource. |
| - | Container | This 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.
Table 3: Properties for a Java Connector Resource
| Fields | Description |
|---|---|
| Shareable | Use 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. |
| Properties | This field displays the property name. This is not editable. |
| Value | Enter the value of the property in this field. |
Click Save to add the Connector Resource to the database.
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.
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 |