iAnywhere Solutions ODBC Drivers
iAnywhere Solutions ODBC Driver for DB2
To configure a data source in the UNIX environment, you must edit the system information file using the attributes in Values for IANAAppCodePage Connection String Attribute. You must also edit this file to perform a translation.
For more information, see Quick start for UNIX.
Users must create the DB2 bind packages on every server to which they intend to connect with the driver. The driver will not work properly with any server that does not have the packages created. The UNIX version of the driver is provided with a program that creates the bind package. It is the equivalent of the Create Package button on the Bind tab of the DB2 driver setup.
The bind program is shipped with SQL Anywhere Studio, and can be found in the drivers/lib directory under your SQL Anywhere directory. You must export LD_LIBRARY_PATH or LIBPATH before creating bind packages.
To bind a package (UNIX)
At a command prompt, enter the following command:
bind19 dsn
where dsn is the ODBC data source name. You are prompted for a user ID and password if they are not stored in the system information file.
To configure a DB2 Wire Protocol data source (Windows)
Start the ODBC Administrator to display a list of data sources.
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 to display a list of installed drivers. Select the DB2 Wire Protocol driver and click Finish to display the ODBC DB2 Wire Protocol Driver Setup dialog box.
NOTE: The General and Bind tabs display only fields that are required for creating a data source. The fields on other tabs are optional, unless noted otherwise.
On the General tab, provide the following information and click Apply.
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 DRDA listener process on the server host machine. 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. 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. 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 dynamic SQL for applications that use this data source definition. The default name is DDODBC.
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.
Optionally, click the Advanced tab to specify data source settings.
On this tab, provide any of the following optional information and click Apply.
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 default), the cursor behavior is Preserve (SQLGetInfo( ) returns SQL_CB_PRESERVE for SQL_COMMIT_CURSOR_BEHAVIOR). When the check box is not selected, the cursor behavior is Delete ( 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.
Alternate ID Type a value to be substituted at connect time for the current schema. This sets the default qualifier for unqualified object names in SQL statements. If the attempt to change the current schema fails, the connection fails with "Invalid value for Alternate ID." DB2 permissions should be set to SYSADM. (Not valid for AS/400 V4R5 and V5R1.)
Translate 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 and click OK to close this dialog box and perform the translation.
Click the Bind tab to configure options for creating bind packages.
The Bind tab allows you to create the bind packages on the server that will be used by the driver. The tab also allows you to specify the behavior of the package. You must create the bind packages on every server to which you intend to connect with the driver. The driver will not work properly with any server that does not have the packages created.
On the Bind tab, provide the following information and click Apply.
Grant Execute Select this check box to grant execute 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.
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. (On AS/400, this is the only the only isolation level that works for collections that do not have journaling enabled.)
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.
Package Owner Package Owner: Type the AuthID assigned to the package. This DB2 AuthID must have authority to execute all the SQL in the package.
Dynamic Sections Type the number of statements that the DB2 Wire Protocol driver package can prepare for a single user. The default is 100.
Create Package Click to configure a package. When you click the Create Package button, a logon dialog is displayed. Enter your user ID and password; then, click Login. A message similar to the following is displayed if the package was not created successfully:
Program name DDODBC not found in plan. Please bind the required packages through the DB2 driver setup screen
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; see Connecting to a data source using a logon dialog box. 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.
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.