Hitachi

uCosminexus Application Server System Setup and Operation Guide


4.1.26 Setting DB Connector (when using CUI)

This subsection describes the setup procedure when using DB Connector as the resource adapter. Implement these settings on the host for allocating the J2EE server. The following table describes the settings used in the example.

Table 4‒12: Settings used in the example (DB Connector settings)

Item

Setup example

Name of the resource adapter file

DBConnector_HiRDB_Type4_CP.rar#

Display name of the resource adapter

DB_Connector_for_HiRDB_Type4

Name of the Connector Property file

MyDBConnectorAttr.xml

Name of the J2EE server for importing resource adapter

MyWebSystem_J2EE01

# RAR file for connecting to HiRDB using the HiRDB Type4 JDBC Driver when there are no local transactions or when transactions are not managed.

For details on the types of available RAR files and their proper usage, see 3.6.4 Types of DB Connector (RAR file) in the uCosminexus Application Server Common Container Functionality Guide.

Organization of this subsection

(1) Acquiring and editing the Connector Property file

  1. Acquire the Connector Property file.

    The template of Connector Property file of DB Connector is available in Application Server. The storage location of the template file is as follows:

    For Windows

    Cosminexus-installation-directory\CC\admin\templates

    For UNIX

    /opt/Cosminexus/CC/admin/templates

    If you are using DB Connector_HiRDB_Type4_CP.rar, acquire DB Connector_HiRDB_Type4_CP_cfg.xml.

    For notes on the template of the Connector Property file, and the template file, see 4.1 HITACHI Connector Property file in the uCosminexus Application Server Application and Resource Definition Reference Guide.

  2. Edit the Connector Property file.

    Save the acquired Connector Property file at any location. Save the Connector Property file as MyDBConnectorAttr.xml.

    Define the necessary items such as settings for connecting to the database, in the saved Connector Property file.

(2) Setting the resource adapter

  1. Start the command prompt on the host for allocating the J2EE server.

  2. Execute the cjimportres command to import the resource adapter to the J2EE server.

    The following is an example of command execution:

    cjimportres MyWebSystem_J2EE01 -nameserver corbaname::192.168.100.12:900 -type rar -f DBConnector_HiRDB_Type4_CP.rar-file-path

    DBConnector_HiRDB_Type4_CP.rar-file-path is Cosminexus-installation-directory\CC\DBConnector\DBConnector_HiRDB_Type4_CP.rar for Windows, and /opt/Cosminexus/CC/DBConnector/DBConnector_HiRDB_Type4_CP.rar for UNIX.

  3. Execute the cjdeployrar command to deploy the resource adapter on the J2EE server.

    The following is an example of command execution:

    cjdeployrar MyWebSystem_J2EE01 -nameserver corbaname::192.168.100.12:900 -resname DB_Connector_for_HiRDB_Type4
  4. Execute the cjsetrarprop command for applying the Connector Property file edited in point (1) Acquiring and editing the Connector Property file, to the resource adapter.

    The following is an example of command execution:

    cjsetrarprop MyWebSystem_J2EE01 -nameserver corbaname::192.168.100.12:900 -resname DB_Connector_for_HiRDB_Type4 -c MyDBConnectorAttr.xml-file-path

    Specify the directory path storing MyDBConnectorAttr.xml as mentioned in (1) Acquiring and editing the Connector Property file, and the file name (MyDBConnectorAttr.xml) in MyDBConnectorAttr.xml-file-path.

(3) Connection test of the resource adapter (for DB connector)

  1. Execute the cjtestres command to check the connections of the resource adapter.

    The following is an example of command execution:

    cjtestres MyWebSystem_J2EE01 -nameserver corbaname::192.168.100.12:900 -resname DB_Connector_for_HiRDB_Type4