About Connect ODBC for DB2 Wire Protocol

Connect ODBC for DB2 Wire Protocol (the "DB2 Wire Protocol driver") supports the following database systems in the following environments:

•	DB2 Universal Database 6.1, 7.1, and 7.2 on Windows NT, Windows 2000, and UNIX

•	DB2 Universal Database for AS/400 V4R5 and V5R1

•	DB2 for OS/390 6.1 and 7 (special licensing only)

The DB2 Wire Protocol driver is supported in the Windows and UNIX environments.

See the README file shipped with your DataDirect product for the file name of the DB2 Wire Protocol driver.


Copyright

DataDirect Connect ODBC for DB2 Wire Protocol

© 2002 DataDirect Technologies. All rights reserved.

DataDirect, DataDirect Connect, and SequeLink are registered trademarks, and Client/Server MiddleWare, DataDirect Connect ADO, DataDirect Connect Integrator, DataDirect Connect JDBC, DataDirect Connect ODBC, DataDirect Connect OLE DB, DataDirect Connect Premium, DataDirect Reflector, and DataDirect SequeLink Integrator are trademarks of DataDirect Technologies. All other trademarks are the property of their respective owners.


Driver Requirements

The server requirement for all platforms is the same. The DB2 database must be installed as the Server Version (not the Local Version).

There is no client requirement for the DB2 Wire Protocol driver.


Configuring Data Sources

Data sources are configured and modified through the ODBC Administrator. To configure a DB2 data source:

1	Start the ODBC Administrator to display list of data sources.

2	If you are configuring an existing data source, select the data source name and click Configure to display the ODBC DB2 Wire Protocol Driver Setup dialog box.

If you are configuring a new data source, click Add. A list of installed drivers appears. Select IBM DB2 and click Finish to display the ODBC DB2 Wire Protocol Driver Setup dialog box.

3	Specify a data source name and database name. Specifying a database description is optional. Click Apply.

4	Click the Advanced tab to configure additional, optional settings for the data source. Click Apply.

5	Click Translate to display the Select Translator dialog box, which lists the translators specified in the ODBC Translators section of the system information. DataDirect provides a translator named OEM to ANSI that translates your data from the IBM PC character set to the ANSI character set.

Select a translator, then click OK to close this dialog box and perform the translation.

6	Click the Bind tab to create bind packages. Click Apply.

7	Click Test Connect to attempt to connect to the data source using the connection properties specified in the Driver Setup dialog box.

8	Click OK or Cancel. If you click OK, the values you have specified become the defaults when you connect to the data source. You can change these defaults by using this procedure to reconfigure your data source. You can override these defaults by connecting to the data source using a connection string with alternate values.


Test Connection

At any point during the configuration process, you can click Test Connect to attempt to connect to the data source using the connection properties specified in the Driver Setup dialog box. A Logon dialog box is displayed. After providing connection information, click OK. Note that the information you enter in the logon dialog box during a test connect is not saved.

•	If the driver can connect, it releases the connection and displays a "connection established" message. Click OK.

•	If the driver cannot connect because of an improper environment or incorrect connection value, it will display an appropriate error message. Click OK.


Connect to a Data Source Using a Logon Dialog Box

Some ODBC applications display a logon dialog box when you are connecting to a data source. In these cases, the data source name has already been specified.

In this dialog box, perform the following steps:

1	In the Ip Address field, type the IP (Internet Protocol) address of the machine where the catalog tables are stored. Specify the address using the machine's numeric address (for example, 123.456.78.90) or specify its host name. If you enter a host name, the driver must find this name (with the correct address assignment) in the HOSTS file on the workstation or in a DNS server.

2	In the Tcp Port field, type the port number that is assigned to the DB2 server on the machine where the catalog tables are stored. Specify either this port's numeric address or its service name (5179 is the default port address). If you specify a service name, the driver must find this name (with the correct port assignment) in the SERVICES file on the workstation.

3	If you are running DB2 on OS/390 or AS/400, perform Steps 3a and 3b. Otherwise, skip to Step 4.

a)	In the Location field, type the DB2 location name. Use the name defined during the local DB2 installation.

b)	In the Collection field, type the name that identifies a group of packages. These packages include the Connect ODBC for DB2 Wire Protocol driver packages. The default is DATADIRECT00.

4	If you are running DB2 on Windows NT or UNIX, type the name of the database to which you want to connect in the Database field. Otherwise, skip to Step 5.

5	If required, type your logon ID in the User Name field.

6	If required, type your password in the Password field.

7	Click OK to complete the logon and to update the values in the system information.


Connecting to a Data Source Using a Connection String
Connecting Using a Connection String

If your application requires a connection string to connect to a data source, you must specify the data source name that tells the driver which section in the system information to use for the default connection information. Optionally, you may specify attribute=value pairs in the connection string to override the default values stored in the system information. These values are not written to the system information.

You can specify either long or short names in the connection string.  The connection string has the form:

DSN=data_source_name[;attribute=value[;attribute=value]...]

An example of a connection string for DB2 is

DSN=DB2MVS;LOC=TESTMVSDB2;UID=JOHN;PWD=XYZZY

The paragraphs that follow give the long and short names for each attribute, as well as a description. The defaults listed are initial defaults that apply when no value is specified in either the connection string or in the data source definition in the system information. If you specified a value for the attribute when configuring the data source, that value is the default.

AddStringToCreateTable (ASCT): A string that is automatically added to all Create Table statements. This field is primarily for users who need to add an "in database" clause.

CharSubTypeType (CST): CharSubTypeType={SYSTEM_DEFAULT | SBCS | MBCS | DBCS}. Determines which character set is specified.

When set to SYSTEM_DEFAULT, the system default value of the DB2 location to which you are binding is used.

When set to SBCS, a single-byte character set is used.

When set to MBCS, a mixed-byte character set is used.

When set to DBCS, a double-byte character set is used.

CloseConversation (CC): CloseConversation={DEALLOC | AT_COMMIT}. Determines when the DB2 Wire Protocol driver closes an LU 6.2 conversation.

When set to DEALLOC (the initial default), the conversation is closed when the client application terminates. Use this value unless you are tuning the system for OLTP applications, or you want to prevent an application from using host resources when a client leaves it idle for an extended period of time.

When set to AT_COMMIT, the conversation is closed after the client application executes a COMMIT statement.

Collection (COL): A name that identifies a group of packages. These packages include the Connect ODBC for DB2 Wire Protocol driver packages. The default is DATADIRECT00. This attribute is valid only if you are connecting to DB2 on OS/390 or AS/400.

ConversationType (CT): ConversationType={SINGLE_BYTE | MIXED_BYTE}. Determines the type of system codes used by DB2. This value indicates the byte format of character data in the command area of a DB2 packet sent from the remote host.

When set to SINGLE_BYTE, the remote host uses a single-byte system code page (as specified in DSNZPARMS on DB2/MVS, for example).

When set to MIXED_BYTE, the remote host is DB2 3.1, and DSNZPARMS specifies a double-byte code page where single-byte and mixed-byte values are not allowed.

Database (DB): The name of the database to which you want to connect. This attribute is valid and required only if you are connecting to DB2 on Windows NT or UNIX.

DataSourceName (DSN): A string that identifies a DB2 data source configuration in the system information. Examples include "Accounting" or "DB2-Serv1."

DecimalDelimiter (DD): DecimalDelimiter={COMMA | PERIOD}. Determines how the decimal point is represented. This is a required field if the DBRM file contains a decimal literal that does not match the host system's default value.

When set to COMMA, the decimal point is represented with a comma, for example, 3,17.

When set to PERIOD, the decimal point is represented with a period, for example, 3.17.

DecimalPrecision (DP): DecimalPrecision={15 | 31}. Determines the number of places following the decimal point that will be calculated.

When set to 15 (the initial default), 15 decimal places are calculated.

When set to 31, 31 decimal places are calculated.

DynamicSections (DS): The number of statements that the DB2 Wire Protocol driver package can prepare for a single user. The initial default is 32.

GrantAuthid (GA): A value that determines to whom execute privileges are granted.

The default value is grant execute privileges on the package to PUBLIC.

GrantExecute (GE): GrantExecute={0 | 1}. Indicates whether or not to grant privileges on the package that you are creating.

When set to 0, privileges are not granted.

When set to 1, privileges are granted.

IpAddress (IP): The IP (Internet Protocol) address of the machine where the catalog tables are stored. Enter the address using the machine's numeric address (for example, 123.456.78.90) or type its address name. If you enter an address name, the driver must find this name (with the correct address assignment) in the HOSTS file on the workstation or in a DNS server.

IsolationLevel (IL): IsolationLevel={ALL | CHANGE | CURSOR_STABILITY | NO_COMMIT| REPEATABLE_READ}. Specifies the method by which locks are acquired and released by the system. Valid values are:

All—Prevents any other process from accessing data that your application has read or modified. All read or modified data is locked until the end of the transaction.

Change—Allows other processes to read from the database. Only modified data is locked until the end of the transaction.

Cursor Stability—Allows other processes to change a row that your application read if the cursor is not on the row that you want to change. Prevents other processes from changing records that your application has changed until your program commits them or terminates. Prevents your program from reading a modified record that has not been committed by another process.

No Commit—Allows your program to read modified records even if they have not been committed by another person.

Repeatable Read—Prevents other processes from changing records that are read or changed by your application (including phantom records) until your program commits them or terminates. Prevents the application from reading modified records that have not been committed by another process. If your program opens the same query during a single unit of work under this isolation level, the results table will be identical to the previous table; however, it can contain updates made by your program.

Location (LOC): A path that specifies the DB2 location name. Use the name defined during the local DB2 installation. This attribute is valid and required only if you are connecting to DB2 on OS/390 or AS/400.

LogonID (UID): The default logon ID used to connect to your DB2 database. A logon ID is required only if security is enabled on your database. If so, contact your system administrator to get your logon ID.

MaximumClients (MC): An integer that specifies the maximum number of concurrent client sessions that the DB2 Wire Protocol driver can carry. If the driver is used with an application server, select a value that will accommodate the number of users who will simultaneously access the host system through the DB2 Wire Protocol driver. In a client configuration, use a small value to reduce the DB2 Wire Protocol driver's memory requirements. The default is 10.

Package (PCK): The name of the package that the driver uses to process static and dynamic SQL for applications that use this data source definition. The default name is DEFxx, where xx is the version number.

PackageOwner (PO): The AuthID assigned to the package. This DB2 AuthID must have authority to execute all the SQL in the package.

Password (PWD): A password used to connect to your DB2 database.

QueryBlockSize (QBS): The number of rows the driver retrieves when fetching from the server. This is not the number of rows given to the user.

The initial default is 8 rows.

ResourceRelease (RR): ResourceRelease={DEALLOCATION | COMMIT}. Specifies the release of database resources.

When set to DEALLOCATION, database resources are released when the connection is terminated.

When set to COMMIT, database resources are released after a commit and provide a high level of concurrency.

ServerCharSet (SCS): Valid values for this attribute are listed in DB2 Code Page Values. Specifies a code page that represents the character set used to store character data in the database.

The default value is 1252 (LATIN-1) for both UDB and MVS databases.

NOTE: The code page (character set) you specify for this attribute must be the same as the character set used by the database. If the values are different, you will fail to connect and receive an error message, for example:

[DataDirect][ODBC DB2 Wire Protocol driver]ServerCharSet ’37’ is incompatible with the Database character set ’1252’

StringDelimiter (SD): StringDelimiter={SINGLE_QUOTE | DOUBLE_QUOTE}. Specifies the type of quotation marks (single or double) used to represent constant string values that are referenced by the SQL in the DBRM. This option must match the option used to delimit the literal strings referenced by your embedded SQL.

TcpPort (PORT): The port number that is assigned to the DB2 server on the machine where the catalog tables are stored. Specify this port's numeric address or its name (5179 is the default port address). If you specify a port name, the driver must find this name (with the correct port assignment) in the SERVICES file on the workstation.

Trace (TR): Trace = {0 | 1}. Determines whether a trace file is created in the application’s directory. When Trace=1, a trace file is created. The trace file name is packet.xxx, where xxx is an incremented number starting with 000.

UserBufferSize (UBS): The size in kilobytes of the bulk packet that the DB2 Wire Protocol driver uses to download data from the host. Valid values are 1 to 63. For most environments, the default value of 32 is sufficient; however, adjusting the value can optimize some client applications as follows:

•	For client applications that frequently download large amounts of data, a large buffer size can improve response time.

•	For client applications that perform brief online transactions, a small buffer will maximize memory on the machine where the DB2 Wire Protocol driver is installed.

WithHold (WH): WithHold={0 | 1}. Specifies the cursor behavior for the application used with this data source—either DB2 closes all open cursors (Delete cursors) after a commit or rollback, or leaves them open (Preserve cursors). When set to 1, the cursor behavior is Preserve. When set to 0, the cursor behavior is Delete (the default).

If you are using the Static Bind Administrator and you want your package to use cursors WITH HOLD, you must set this attribute to 1. Note that any application using this package must use a data source with this attribute set to 1.

When set to 1:

•	The Static Bind Administrator automatically adds the WITH HOLD clause to queries that it puts in the application's database resource module (DBRM). The WITH HOLD clause prevents DB2 from automatically closing the cursor when the application executes a Commit statement.

•	SQLGetInfo( ) returns SQL_CB_PRESERVE for SQL_COMMIT_CURSOR_BEHAVIOR.

When set to 0, SQLGetInfo( ) returns SQL_CB_DELETE. For information about this function, refer to the Microsoft ODBC API.


Data Types

The DB2 data types map to the standard ODBC data types as follows.

DB2	ODBC
Char	SQL_CHAR
Char() for Bit Data	SQL_BINARY
Clob*	SQL_LONGVARCHAR
Date	SQL_TYPE_DATE
Decimal	SQL_DECIMAL
Float	SQL_DOUBLE
Graphic	SQL_BINARY
Integer	SQL_INTEGER
Long Varchar	SQL_LONGVARCHAR
Long Varchar for Bit Data	SQL_LONGVARBINARY
Long Vargraphic	SQL_LONGVARBINARY
Smallint	SQL_SMALLINT
Time	SQL_TYPE_TIME
Timestamp	SQL_TYPE_TIMESTAMP
Varchar	SQL_VARCHAR
Varchar() for Bit Data	SQL_VARBINARY
Vargraphic	SQL_VARBINARY
* Only the first 32K of the Clob data types are returned when fetching these data types from DB2 databases. Also, only 32K can be inserted and updated on DB2 databases.


Isolation and Lock Levels Supported

DB2 supports isolation levels 0 (read uncommitted), 1 (read committed), and 2 (repeatable read). It supports record-level locking.

NOTE: An isolation level can be set only before connecting to a DB2 database.


ODBC Conformance Level

The API functions supported are listed in “Supported ODBC Functions,” found in the General Help section of the Connect ODBC Help file. In addition, the following functions are supported:

•	SQLProcedures

•	SQLProcedureColumns

The driver supports the minimum SQL grammar.


Number of Connections and Statements Supported

The DB2 database system supports multiple connections and multiple statements per connection.


General Tab, ODBC DB2 Wire Protocol Driver Setup

Use the ODBC DB2 Wire Protocol Driver Setup dialog box to create new DB2 data sources or configure existing data sources.

Data Source Name: Type a string that identifies this DB2 data source configuration in the system information. If you are creating a new data source definition, type a unique name of up to 32 characters. If you specify the name of an existing data source definition, the new settings will replace the existing ones.

Description: Type an optional descriptive comment for this data source definition. ODBC-related applications and development tools often display this description with the data source name when they display a list of data sources. If you want to include a description for this data source definition, type a comment of up to 64 characters.

IP Address: Type the IP (Internet Protocol) address of the machine where the catalog tables are stored. Specify the address using the machine's numeric address (for example, 123.456.78.90) or specify its host name. If you enter a host name, the driver must find this name (with the correct address assignment) in the HOSTS file on the workstation or in a DNS server.

TCP Port: Type the port number that is assigned to the DB2 server on the machine where the catalog tables are stored. Specify either this port's numeric address or its service name (5179 is the default port address). If you specify a service name, the driver must find this name (with the correct port assignment) in the SERVICES file on the workstation.

Location Name: This field is valid only if you are connecting to a DB2 database running on OS/390 or AS/400. Type the DB2 location name. Use the name defined during the local DB2 installation.

NOTE: This field is disabled if the Database Name field is populated.

Collection: This field is valid only if you are connecting to a DB2 database running on OS/390 or AS/400. Type the name that identifies a group of packages. These packages include the Connect ODBC for DB2 Wire Protocol driver packages. The default is DATADIRECT00.

NOTE: This field is disabled if the Database Name field is populated.

Database Name: This field is valid only if you are connecting to a DB2 database running on UNIX or NT. Type the name of the database to which you want to connect.

NOTE: This field is disabled if the Location Name field is populated.

Package: Type the name of the package that the driver uses to process static and dynamic SQL for applications that use this data source definition. The default name is DEFxx, where xx is the version number.

Default User ID: Type the default logon ID used to connect to your DB2 database. Your ODBC application may override this value or you may override it in the logon dialog box or connection string. This field is optional.

Server Charset: Type the number of the code page that represents the character set used to store character data in the database.  Valid values are listed in DB2 Code Page Values.

The default value is 1252 (LATIN-1) for both UDB and MVS databases.

NOTE: The code page (character set) you specify for this attribute must be the same as the character set used by the database. If the values are different, you will fail to connect and receive an error message, for example:

[DataDirect][ODBC DB2 Wire Protocol driver]ServerCharSet ’37’ is incompatible with the Database character set ’1252’

Advanced Tab

Displays the Advanced tab, where you can configure additional options for this data source.

Bind Tab

Displays the Bind tab, where you can create the default package for the Connect ODBC for DB2 Wire Protocol driver.

OK

Cancel

Apply

Test Connect


Advanced Tab, ODBC DB2 Wire Protocol Driver Setup

Use the Advanced tab on the ODBC DB2 Wire Protocol Driver Setup dialog box to specify optional settings when you create new DB2 data sources or configure existing data sources.

Query Block Size: Type the number of rows the driver retrieves when fetching from the server. This is not the number of rows given to the user. The default is 8 rows.

Conversation Type: Select the type of system codes used by DB2. This value indicates the byte format of character data in the command area of a DB2 packet sent from the remote host. The possible values are:

Single Byte—Used if the remote host uses a single-byte system code page (as specified in DSNZPARMS on DB2/MVS, for example).

Mixed Byte—Used if the remote host is DB2 3.1 and DSNZPARMS specifies a double-byte code page where single-byte and mixed-byte values are not allowed

Close Conversation: Select a value to determine when the DB2 Wire Protocol driver closes an LU 6.2 conversation. The possible values are:

At Dealloc—Conversation is closed when the client application terminates.

At Commit—Conversation is closed after the client application executes a COMMIT statement.

Use the default value At Dealloc unless you are tuning the system for OLTP applications, or you want to prevent an application from using host resources when a client leaves it idle for an extended period of time.

User Buffer Size: Type the size (in kilobytes) of the bulk packet that the DB2 Wire Protocol driver uses to download data from the host. Permitted values are 1 to 63. For most environments, the default value of 32 is sufficient; however, adjusting the value can optimize some client applications as follows:

•	For client applications that frequently download large amounts of data, a large buffer size can improve response time.

•	For client applications that perform brief online transactions, a small buffer will maximize memory on the machine where the DB2 Wire Protocol driver is installed.

Maximum Clients: Type the maximum number of concurrent client sessions (maximum number of connections allowed) that the DB2 Wire Protocol driver can carry. If the driver is used with an application server, select a value that will accommodate the number of users who will simultaneously access the host system through the DB2 Wire Protocol driver. In a client configuration, use a small value to reduce the DB2 Wire Protocol driver's memory requirements. The default is 10.

Trace: Select this check box to generate a trace file in the application’s directory. The trace file name is packet.xxx, where xxx is an incremented number starting with 000.

With Hold Cursors: This option specifies the cursor behavior for the application used with this data source—either DB2 closes all open cursors (Delete cursors) after a commit or rollback or leaves them open (Preserve cursors). When this check box is selected, the cursor behavior is Preserve. Otherwise, the cursor behavior is Delete (the default).

If you are using the Static Bind Administrator and you want your package to use cursors WITH HOLD, you must select this check box. Note that any application using this package must use a data source with this option set.

When this option is enabled:

•	The Static Bind Administrator automatically adds the WITH HOLD clause to queries that it puts in the application's database resource module (DBRM). The WITH HOLD clause prevents DB2 from automatically closing the cursor when the application executes a Commit statement.

•	SQLGetInfo( ) returns SQL_CB_PRESERVE for SQL_COMMIT_CURSOR_BEHAVIOR.

When this option is not enabled, SQLGetInfo( ) returns SQL_CB_DELETE. For information about this function, refer to the Microsoft ODBC API.

Add to Create Table: Type a string that is automatically added to all Create Table statements. This field is primarily for users who need to add an "in database" clause.

Translate Button

Displays the Select Translator dialog box, where you can translate your data from one character set to another. Choose the OEM to ANSI translator to translate your data from the IBM PC character set to the ANSI character set.

Bind Tab

Displays the Bind tab, where you can create the default package for the Connect ODBC for DB2 Wire Protocol driver.

OK

Cancel

Apply

Test Connect


Bind Tab, ODBC DB2 Wire Protocol Driver Setup

The Bind tab allows the user to create dynamically the bind packages on the server that will be used by the driver.  The tab also allows the user to specify the behavior of the package.  Users must create the bind packages on every server to which they intend to with the driver.  The driver will not work properly against any server that does not have the packages created.

Grant Execute: Select this check box to indicate whether or not to grant privileges on the package that you are creating. The default value is grant execute privileges on the package to PUBLIC. You can also specify to whom to grant execute privileges.

Char Sub Type: Select a value to specify the options for storing ambiguous character data in the database. The possible values are:

System Default—Specifies system default value of the DB2 location to which you are binding.

SBCS—Specifies a single-byte character set.

MBCS—Specifies a mixed-byte character set.

DBCS—Specifies a double-byte character set.

Decimal Delimiter: Select a value to specify how the decimal point is represented. This is a required field if the DBRM file contains a decimal literal that does not match the host system's default value. The possible values are:

Period—The decimal point is represented with a period, for example, 3.17. This is the default.

Comma—The decimal point is represented with a comma, for example, 3,17.

Decimal Precision: Select a value to specify the number of places following the decimal point that will be calculated. Valid values are:

15—15 decimal places (the default)

31—31 decimal places

String Delimiter: Select a value to specify the type of quotation marks (single or double) used to represent constant string values that are referenced by the SQL in the DBRM. This option should match the option used to delimit the literal strings referenced by your embedded SQL. The default is single.

Isolation Level: Select the method by which locks are acquired and released by the system. Valid values are:

All—Prevents any other process from accessing data that your application has read or modified. All read or modified data is locked until the end of the transaction.

Change—Allows other processes to read from the database. Only modified data is locked until the end of the transaction.

Cursor Stability (the default)—Allows other processes to change a row that your application has read if the cursor is not on the row you want to change. Prevents other processes from changing records that your application has changed until your program commits them or terminates. Prevents your program from reading a modified record that has not been committed by another process.

No Commit—Allows your program to read modified records even if they have not been committed by another person.

Repeatable Read—Prevents other processes from changing records that are read or changed by your application (including phantom records) until your program commits them or terminates. Prevents the application from reading modified records that have not been committed by another process. If your program opens the same query during a single unit of work under this isolation level, the results table will be identical to the previous table; however, it can contain updates made by your program.

Resource Release: Select a value to specify the release of database resources. Two options are available:

Commit—Releases database resources after a commit and provides a high level of concurrency.

Deallocation—Releases database resources when the connection is terminated. This is the default.

Dynamic Sections: Type the number of statements that the DB2 Wire Protocol driver package can prepare for a single user. The default is 32.

Package Owner: Type the AuthID assigned to the package. This DB2 AuthID must have authority to execute all the SQL in the package.

Create Package: Click to configure a package. Before you can use the DB2 Wire Protocol driver, you must create a default DBRM for the link and bind it to DB2. The default DBRM creates a package that the DB2 Wire Protocol driver uses to execute dynamic SQL statements from your application.

When you click the Create Package button, a logon dialog is displayed. Enter your user ID and password; then, click Login. A message is displayed if the package was not created successfully.

Each time that you bind a DBRM, the Bind Utility creates a log file (.LOG) in which it records all errors that occur during the bind. The .LOG file is stored locally in the same directory as your DBRM (.DBR). If no error has occurred during the binding of a particular DBRM, the log file does not exist.

OK

Cancel

Apply

Test Connect


Logon to DB2 Dialog

Ip Address: Type the IP (Internet Protocol) address of the machine where the catalog tables are stored. Specify the address using the machine's numeric address (for example, 123.456.78.90) or specify its host name. If you enter a host name, the driver must find this name (with the correct address assignment) in the HOSTS file on the workstation or in a DNS server.

Tcp Port: Type the port number that is assigned to the DB2 server on the machine where the catalog tables are stored. Specify either this port's numeric address or its service name (5179 is the default port address). If you specify a service name, the driver must find this name (with the correct port assignment) in the SERVICES file on the workstation.

Location: Valid only for DB2 running on OS/390. Type the DB2 location name. Use the name defined during the local DB2 installation.

Collection: Valid only for DB2 running on OS/390. Type the name that identifies a group of packages. These packages include the Connect ODBC for DB2 Wire Protocol driver packages. The default is DATADIRECT00.

Database: Valid only for DB2 running on Windows NT or UNIX. Type the name of the database to which you want to connect.

User Name: If required, type your logon ID.

Password: If required, type your password for the system.


Apply Button

Writes the settings you have specified to the system information. These settings remain in effect until you change them in this dialog box. Clicking Cancel does not affect settings that have been applied.


OK Button

Writes the settings you have specified to the system information and closes the dialog box.


Cancel Button

Closes the dialog box without saving settings that have not been applied.


Contacting Technical Support

DataDirect Technologies provides technical support for all registered users of this product, including limited installation support, for the first 30 days. You can register online for your SupportLink user ID and password, which provide access to the password-protected areas of the SupportLink web site, at http://support.datadirect-technologies.com. Select Register on the left toolbar, complete the information on the Register page, and click Submit. Your user ID and password are issued to you by email upon registration.

For support after 30 days, contact us using one of the following methods or purchase further support by enrolling in the SupportLink program. For more information about SupportLink, contact your sales representative.

The DataDirect Technologies web site provides the latest support information through SupportLink Online, our global service network that provides access to support contact details, tools, and valuable information. Our SupportLink users access information using the web and automatic email notification. SupportLink Online includes a knowledge base that allows you to search on keywords for technical bulletins and other information. You also can download product fixes and upgrades for your DataDirect products.

World Wide Web

http://support.datadirect-technologies.com

E-Mail

USA, Canada, Mexico, Australia, and Asia Pacific (except Japan)	datadirect.answerline@datadirect-technologies.com!
Japan	jpn.answerline@datadirect.co.jp! (beginning March 2002) dd.answerline@merant.co.jp! (until March 2002)
All other countries	int.datadirect.answerline@datadirect-technologies.com!
Local Telephone Support

Local phone numbers can be found at:

http://support.datadirect-technologies.com/websupport/supportnet/datadirect/
supportnetanswerline.asp

NOTE: You must have a SupportLink user ID and password to access this web site. You can register online for your SupportLink user ID and password at http://support.datadirect-technologies.com. Select Register on the left toolbar, complete the information on the Register page, and click Submit. Your user ID and password are issued immediately and confirmation is sent to you by email.

Answerline support is available 24 hours a day, seven days a week.

Fax Information

Fax US	1 919 461 4527
Fax Int.	+32 (0) 15 32 09 19

Information to Provide

When you contact us, please include this information:

•	The product serial number or a case number. If you do not have a SupportLink contract, we will ask you to speak with a sales representative.

•	Your name and organization. For a first-time call, you may be asked for full customer information, including location and contact details.

•	The version number of your DataDirect product.

•	The type and version of your operating system.

•	Any third-party software or other environment information required to understand the problem.

•	A brief description of the problem, including any error messages that you have received, and the steps preceding the occurrence of the problem. Depending on the complexity of the problem, you may be asked to submit an example so that we can recreate the problem.

•	An assessment of the severity level of the problem.


Stored Procedure Support

The DB2 Wire Protocol driver supports DB2 Remote Procedure Calls (RPCs) with the following restrictions:

•	Multiple result sets are not returned; only the first result set is returned.

•	RPCs must take an argument list. The driver does not support RPCs that use a SQL descriptor area (SQLDA) data structure to specify the arguments.

•	Literals are not supported as stored procedure parameters.


Persisting a Result Set as an XML Data File

This driver allows you to persist a result set as an XML data file with embedded schema. To implement XML persistence, a client application must do the following:

1	Turn on STATIC cursors. For example:

SQLSetStmtAttr (hstmt, SQL_ATTR_CURSOR_TYPE, SQL_CURSOR_STATIC, SQL_IS_INTEGER)

NOTE: A result set can be persisted as an XML data file only if the result set is generated using STATIC cursors. Otherwise, the following error is returned:

Driver only supports XML persistence when using driver’s static cursors.

2	Execute a SQL statement. For example:

SQLExecDirect (hstmt, "Select * from GTABLE", SQL_NTS)

3	Persist the result set as an XML data file. For example:

SQLSetStmtAttr (hstmt, SQL_PERSIST_AS_XML, "c:\temp\GTABLE.XML", SQL_NTS)

NOTE: A new statement attribute is available to support XML persistence, SQL_PERSIST_AS_XML. A client application must call SQLSetStmtAttr with this new attribute as an argument. See the following table for the definition of valid arguments for SQLSetStmtAttr.

Argument	Definition
StatementHandle	The handle of the statement that contains the result set to persist as XML.
Attribute	SQL_PERSIST_AS_XML. This new statement attribute can be found in the file qesqlext.h, which is installed with the driver.
ValuePtr	Pointer to a URL that specifies the full path name of the XML data file to be generated. The directory specified in the path name must exist, and if the specified file name exists, the file will be overwritten.
StringLength	The length of the string pointed to by ValuePtr or SQL_NTS if ValuePtr points to a null terminated string.

A client application can choose to persist the data at any time that the statement is in an executed or cursor positioned state. At any other time, the driver will return the following message:

Function Sequence Error

Using the Windows XML Persistence Demo Tool

On Windows, Connect ODBC is shipped with an XML persistence demo tool. This tool is installed in the Connect ODBC installation directory.

The tool has a graphical user interface and allows you to persist data as an XML data file. To use this tool, take the following steps:

1	From the DataDirect Technologies Connect ODBC 4.10 program group, select XML Persistence Demo. The XML Persistence dialog box appears.

2	First, you must connect to the database. Click Connect. The Select Data Source dialog box appears.

3	You must either select an existing data source or create a new one. Take one of the following actions:

•	Select an existing data source and click OK.

•	Create a new file data source by clicking New. The Create New Data Source dialog box appears. Follow the instructions in the dialog box.

•	Create a new machine data source by clicking the Machine Data Source tab and clicking New. The Create New Data Source dialog box appears. Follow the instructions in the dialog box.

4	After you have connected to a database, type a SQL Select statement in the Query text box of the XML Persistence dialog box. Then, click Persist. The Save As dialog box appears.

5	Specify a name and location for the XML data file that will be created. Then, click OK.

Note that the Status box in the XML Persistence dialog box displays whether or not the action failed or succeeded.

6	Click Disconnect to disconnect from the database.

7	Click Close to exit the tool.


DB2 Code Page Values

The following table lists the most commonly used DB2 code pages and their numerical values. These values are valid for the ServerCharSet connection string attribute. For a complete listing of all valid DB2 code pages and their values, refer to IBM DB2 Administration Guide.

Code Page Value	Code Page Name
437	IBM CP437 US code set
850	IBM CP850 European code set
912	ISO 8859-2 Latin-2/Eastern Europe
914	ISO 8859-4 Latin/Estonian/Latvian
916	ISO 8859-8 Latin/Hebrew
916	ISO 8859-8 Latin/Hebrew
920	ISO 8859-9 Latin-5/Turkish
920	ISO 8859-9 Latin-5/Turkish
923	ISO 8859-15 Latin1 with Euro, etc.
950	Traditional Chinese
1089	ISO 8859-6 Latin/Arabic
1200	Unicode Encoding UCS-2
1208	Unicode Encoding UTF-8
1252	ISO 8858-1 Latin-1


Windows

•	Windows 98

•	Windows Me

•	Windows NT with Service Pack 5 and higher

•	Windows 2000 with Service Pack 1 and higher

•	Windows XP Home Edition and Professional


UNIX

•	AIX 4.3.3 and higher with the 5.0.2.0 C++ runtime libraries

•	HP-UX 11 and 11i

•	Sun Solaris 7 and 8

•	Linux (Red Hat Linux 6.2, 7.1, and 7.2; Caldera OpenLinux 2.3 and 3.1; SuSE Linux 6.4 and 7.3)