Several language environments are preconfigured in the Net.Data initialization file, DB2WWW.INI. Each language environment has an ENVIRONMENT statement in the initialization file that contains information specific to that language environment. An ENVIRONMENT statement has this format:
ENVIRONMENT(type) library-name([usage parameter, ...])The following example shows ENVIRONMENT statements for language environments supplied by Net.Data. These examples illustrate all the parameters that you can specify. The variables you include in the ENVIRONMENT statements are ones which you want to allow Net.Data macro writers to set or override in their macros. Language environment statements in the initialization file are also used for Net.Data built-in functions. See the platform specific information in the appendixes in Net.Data Reference Guide or in your Net.Data README file or Program Directory for additional examples.
ENVIRONMENT (DTW_SQL) DTWSQL ( IN DATABASE, LOGIN, PASSWORD, TRANSACTION_SCOPE, SHOWSQL, ALIGN, START_ROW_NUM) ENVIRONMENT (DTW_SYB) DTWSYB ( IN DATABASE, LOGIN, PASSWORD, TRANSACTION_SCOPE, SHOWSQL, ALIGN, START_ROW_NUM) ENVIRONMENT (DTW_ODBC) DTWODBC ( IN DATABASE, LOGIN, PASSWORD, TRANSACTION_SCOPE, SHOWSQL, ALIGN) ENVIRONMENT (DTW_APPLET) DTWJAVA ( ) ENVIRONMENT (DTW_JAVAPPS) ( OUT RETURN_CODE ) CLIETTE "DTW_JAVAPPS" ENVIRONMENT (DTW_PERL) DTWPERL ( OUT RETURN_CODE ) ENVIRONMENT (DTW_REXX) DTWREXX ( OUT RETURN_CODE ) ENVIRONMENT (DTW_SYSTEM) DTWSYS ( OUT RETURN_CODE )
OS/390 differs slightly for SQL and ODBC access:
ENVIRONMENT (DTW_SQL) DTWSQL ( IN LOCATION, DB2SSID, DB2PLAN, TRANSACTION_SCOPE, ALIGN) ENVIRONMENT (DTW_ODBC) DTWODBC ( IN LOCATION, TRANSACTION_SCOPE, ALIGN)
These are the parameters you must specify for each language environment:
This is a name that associates this language environment with a FUNCTION block defined in a Net.Data macro. You must specify the type on a FUNCTION block definition to tell Net.Data that on a function call, this language environment processes the call.
This is the name of the object containing the language environment interfaces that are called by Net.Data. In OS/2, the DLL name is specified without the .dll extension. In AIX, the name of the shared object is specified with the .o extension, and in OS/400, the service program name is specified with the .SRVPGM extension. OS/390 has no extensions for DLL files. Look at the initialization file shipped with Net.Data for your platform to see how to specify this name. Consider using a fully qualified path name to make sure Net.Data finds the DLL or shared library.
This is a list of parameters that are passed to the language environment on each function call, in addition to those parameters specified in the FUNCTION block definition. They are passed in the parm_data_array field of the dtw_lei_t structure following the parameters specified in the FUNCTION block definition. You must define these parameters as variables in your Net.Data macro before the function call is made. The parameter names inside the FUNCTION block must match the arguments outside the block. Any of these parameters modified by a function keep their modified value once the function completes.
The configuration information is read when Net.Data starts, but a language environment DLL or shared library is not loaded until a FUNCTION block identifying that language environment is called. The DLL remains loaded until Net.Data ends.
Each ENVIRONMENT statement must be on a single line. The language environment can retrieve the value of a configuration variable with the dtw_getvar() routine, and can modify the value using the dtw_setvar() routine. See details in dtw_getvar() and dtw_setvar().
Language environments might require additional configuration information. You can specify the information in the Net.Data initialization file by configuration variable statements. These statements have this form:
NAME [=] value-string
For example:
DB2INSTANCE = DB2