Common Sections of the Net.Data Initialization, Control, and Macro Files

Certain portions of the Net.Data initialization, configuration, and macro files must be consistent for all components of Net.Data to work as a whole. The following table summarizes the areas of each of these files that must match.

Table 2. Consistency Requirements for the Net.Data Configuration Files and the Macro
File Common Sections Notes
Net.Data INI File Environment Statement The language environments that use Live Connection must specify the database cliette name in their environment statement
Live Connection configuration variables When using Net.Data Live Connection, specify the Live Connection port, DTW_CM_PORT. This variable value must match the MAIN_PORT value in the Live Connection configuration file.
Cache configuration variables When using Net.Data caching, optionally include port number and machine name variables. These values must match those used in the Cache Manager configuration file, if used.
Live Connection Configuration File Cliette Definitions Each cliette definition must match a corresponding definition in the INI file. Additionally, the MAIN_PORT value must match the DTW_CM_PORT variable value in the INI file.
Cache Manager Configuration File Cache Manager Configuration Variables When using Net.Data caching, you can optionally include port number and machine name variables. These values must match those used in the INI file, if used.

The following fragments illustrate the relationship between a macro, a Net.Data initialization file, and a Live Connection configuration file. Two cliettes are used by the macro (DTW_SQL:SAMPLE, DTW_SQL:CELDIAL ) and access two DB2 databases, called SAMPLE and CELDIAL. The Live Connection configuration file contains the cliette names and definitions. The ENVIRONMENT statement in the Net.Data initialization file refers to the cliette name. The LOGIN and PASSWORD values are specified in the Live Connection configuration file.

Figure 2 shows a fragment of the macro that contains the @DTW_ASSIGN statement that defines which cliette is to be used to access a database.

Figure 2. Net.Data Macro Fragment




<3*********************************************>
<3** This is an HTML comment **>
<3** Access the SAMPLE database using **>
<3** cliette DTW_SQL:SAMPLE **>
<3*********************************************>
@DTW_ASSIGN (DATABASE, " SAMPLE ")
@insert_customer
(customer_name, customer_street, customer_city, customer_state,
customer_country, customer_zip, customer_credit, customer_expiry)



<3*********************************************>
<3** This is an HTML comment **>
<3** Process the CELDIAL database using **>
<3** the cliette DTW_SQL:CELDIAL **>
<3*********************************************>
@DTW_ASSIGN (DATABASE, " CELDIAL ")
@insert_customer
(customer_name, customer_street, customer_city, customer_state,
customer_country, customer_zip, customer_credit, customer_expiry)


Note that the DATABASE configuration variable is substituted into the ENVIRONMENT statement of the initialization file to generate the cliette name. This allows you to access multiple databases from the same macro.

Figure 3 shows a fragment of the Net.Data initialization file that contains the ENVIRONMENT statement and the associated cliette type. There is one ENVIRONMENT statement for each cliette type in the initialization file. For each database cliette type, the ENVIRONMENT statement specifies a cliette name. The name is made up of the cliette type and a variable reference, $(DATABASE), which is resolved at run time. Each language environment that uses Live Connection must have a cliette definition in the ENVIRONMENT statement.

Figure 3. Net.Data Initialization File Fragment




ENVIRONMENT (DTW_SQL)
(IN DATABASE, LOGIN, PASSWORD, TRANSACTION_SCOPE, SHOWSQL,
ALIGN, START_ROW_NUM, DTW_SET_TOTAL_ROWS)
CLIETTE "DTW_SQL:$(DATABASE)"


Figure 4 shows a fragment of the Live Connection configuration file, which contains the cliette definitions for DTW_SQL:CELDIAL and DTW_JAVAPPS.

Figure 4. Live Connection configuration file fragment




CONNECTION_MANAGER{
MAIN_PORT=7100
ENCRYPTION=OFF
}


###############################################################
# This is a comment in a Live Connection configuration file.
# Comments start with a pound (hash) character.
# Comments terminate at the end of the line and do not continue to
# the next line unless another pound (hash) character is specified.
# You can include comments at the end of lines containing Live
# Connection keywords except on password lines.
# You cannot include comments anywhere on lines containing the
# password keyword.
# You cannot include spaces and pound (hash) characters within any
# name, such as cliette name or in database cliette passwords.
###############################################################
CLIETTE DTW_SQL:CELDIAL{
MIN_PROCESS=1
MAX_PROCESS=5
EXEC_NAME=./dtwcdb2
DATABASE=CELDIAL
LOGIN=marshall
PASSWORD=stlpwd
}


CLIETTE DTW_JAVAPPS{
MIN_PROCESS=1
MAX_PROCESS=5
EXEC_NAME=./javaapp
}



[ Top of Page | Previous Page | Next Page | Index ]