Hitachi

uCosminexus Application Server System Setup and Operation Guide


4.1.6 Setting the database connection environment (setting HiRDB)

Use DB Connector as the resource adapter to connect to the database from J2EE application on the J2EE server. The JDBC driver that supports the database is necessary to connect to the database by using DB Connector.

This subsection describes the database connection environment settings required for connecting to HiRDB by using DB Connector. The JDBC driver uses HiRDB Type4 JDBC Driver. Implement these settings on the host for allocating the J2EE server.

For details on the notes on setting up a database, see 4.1.9 Notes on setting up a database.

Organization of this subsection

(1) Preparing HiRDB Type4 JDBC Driver

This section describes the preparation of HiRDB Type4 JDBC Driver.

  1. Prepare the JAR files for HiRDB Type4 JDBC Driver.

    For details on the JAR files, see the HiRDB UAP Development Guide.

  2. Set the path of the JAR file for HiRDB Type4 JDBC Driver, prepared in step 1, in the Easy Setup definition file.

    Add the following settings in the configuration tag in the J2EE server definition of physical tier definition (definition of tier tag) when creating an Easy Setup definition file.

    Specification value for <param-name> tag

    Specification value for the <param-name> tag

    add.class.path

    Class-path-of-JAR-file

    For details on creating an Easy Setup Definition file, see 4.1.20 Setting the Easy Setup definition file. For details on settings, see 4.3 Easy Setup definition file in the uCosminexus Application Server Definition Reference Guide.

(2) Creating HiRDB client environment variable group setting file

Create a setup file of the HiRDB client environment variable group to use the HiRDB client environment variable group. In such cases, specify the path of the created setup file in the part specifying the HiRDB client environment variable group name in the property definition of DB Connector. For details on how to create the setup file, see the HiRDB UAP Development Guide.

You must set the HiRDB client environment variable group for using the global transaction. When you are not using the global transaction, using the HiRDB client environment variable group is optional.

(3) Setting up the system properties

You can also specify the HiRDB settings as system properties. The property name begins with HiRDB_for_Java_. Specify the system properties for the J2EE server in the user property file for J2EE servers (usrconf.properties).

(For example) HiRDB_for_Java_UPDATECOUNT_BEHAVIOR=TRUE

For details on the HiRDB system properties, see the HiRDB UAP Development Guide.

Do not set up the properties that can be specified in the Hitachi Connector property file and the setup file of the HiRDB client environment variable group, with the system properties.

(4) Setting Timeout

You can set the HiRDB timeout by adding the following HiRDB client environment variable to the environment variables property of DB Connector or the setup file of HiRDB client environment variable group.

Set the timeout for establishing connection in the loginTimeout property of DB Connector. However, even when you set the value in the setLoginTimeout method of HiRDB Type4 JDBC Driver, timeout during login might not be executed.

Set the property of DB Connector when deploying a resource adapter before or after the system setup. For details on deploying a resource adapter, see 4.1.26 Setting DB Connector (when using CUI) or 4.1.27 Setting resource adapters other than DB Connector (when using CUI).

Also, for details on setting a timeout, see 8.6.6 Setting the database timeout in the uCosminexus Application Server System Design Guide. For details on setting the property of DB Connector, see 4.2.2 Defining the DB Connector properties in the uCosminexus Application Server Application Setup Guide.