Configuring a Datasource

To create and configure datasource entries for DRDA, specify the required parameters settings in the ODBC Data Source Administrator dialog.

  1. Select the General tab and enter the connectivity parameters and test them. Be sure you have consulted your database administrator for the required collection and package names. (Packages are created in the Bind section that follows.)

    The General parameters specify the connectivity settings. The required parameters are indicated by an asterisk (*)

    General Parameters

    Parameter

    Comments

    *Data Source Name

    Type a string that identifies this DB2 datasource configuration in the system information.

    If you are:
    • Creating a new datasource definition, type a unique name of up to 32 character.
    • Specifying the name of an existing datasource definition, the new settings replace the existing ones.

    Description

    Type an optional descriptive comment for this datasource definition.

    *Ip address

    Type the Internet Protocol (IP) 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 data source name (DSN) server.

    *TCP Port

    Enter 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. The default numeric port address varies depending on the OS of the DB2 server machine. The default for:
    • DB2 may be 50000
    • AS/400 is 446

    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, using 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 DB2 DRDA driver packages.

    The default for:
    • DB2 is DATADIRECT00
    • AS/400 is SYBASE
    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 Windows. 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

    Enter the name of the package that the driver uses to process static and dynamic SQL for applications that use this datasource definition.

    The default name is DEFxx, where xx is the version number.

    Default User ID

    Not used by ECDA.

    WorkArounds2

    The name of the string key to allow the driver to pad the DB2 char for bit data field with spaces. The value is 131072. See the WorkArounds2 string key procedure .

  2. After you enter this information, click Test Connect. If the connection fails, check for accurate information.
  3. Select the ODBC Administrator Advanced tab, which contains optional fields that can affect performance and resource use.
    Note: The default values for the remaining optional parameters should be sufficient for most DRDA installations.
  4. Enter values for the required parameters, indicated by an asterisk (*).
    Advanced Parameters

    Parameter

    Comments

    Add to Create Table

    Use Add to Create Table to append the in tablespace clause to create table commands.

    Alternate ID

    Enter 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 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.)

    *WithHold Cursors

    Select this option for ECDA. It determines whether cursors are preserved or deleted after a commit or rollback.

    *Application Using Threads

    This option is required for ECDA.

  5. Select the Bind tab of the DRDA Driver Setup window to define the package.

    The Bind tab allows you to create the bind packages on the server that is used by the driver and specify the behavior of the package.

    Before the DRDA driver can be used, you must create the required packages and bind them to the DB2 system. The driver does not work properly with any server that does not have the packages created. After the packages are created, you can rebind them with new bind parameters as needed.

    Note: Consult your DB2 database administrator when attempting to create packages. You need a login with sufficient authorization to create packages and grant execution privileges. You may need a DB2 database administration experience to capture and analyze package creation errors.
  6. Enter values for the required parameters, indicated by an asterisk (*). The default values for the remaining optional parameters should be sufficient for most DRDA installations.
    Bind Parameters

    Parameters

    Comments

    *Grant Execute

    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.

    *Isolation Level

    Select the isolation level 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. It 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. It 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 is identical to the previous table; however, it can contain updates made by your program.

    *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 32. This value determines the maximum cursors or dynamic statements that a single connection may have open simultaneously.

  7. Create a package.
    1. Click Create Package.
    2. Enter your user ID and password.
    3. Click Login.

A separate package is not needed for each access service; however, if the access service has different characteristics in its parameters that suit it for a specific solution, you can create other packages for other solutions.

Related tasks
Adding the WorkArounds2 String Key to Pad DB2 Character Data