Connecting to IBM Db2 for i

Prev Next

When connecting to a IBM Db2 for i database from the Syniti Knowledge Platform (SKP), provide the following connection properties to establish a secure and reliable connection. This article explains each property to understand what information is required and how it is used.

Property

Description

Notes

Name
(required)

Name of the IBM Db2 i connection unique to the SKP.

NA

Description

Enter a description that briefly states the purpose of this connection.

NA

Hostname
(required)

Hostname is the network name or IP address of the IBM Db2 machine you want to connect to.

NA

Port
(required)

The TCP/IP port number on which the Db2 database listens for incoming connections.

Default for Db2 for i is typically 50000 unless explicitly configured otherwise.

Username
(required)

The database account identifier used for authentication when establishing the connection.

The account must have the necessary privileges for the operations being performed.

Password
(required)

The password for the username above.

This value is used to authenticate the connection to the database.

Database

The name of the specific Db2 database instance to connect to on the server.

Db2 servers can host multiple logical databases.

Host Code Page
(required)

The code page setting that influences character encoding conversion between the client and database.

Ensures correct interpretation of text data across differing regional or system defaults.

Isolation Level

The transactional isolation mode (e.g., Uncommitted Read, Cursor Stability, Repeatable Read) that governs visibility of data changes during concurrent access.

Options include:

* None (No Commit)

* All (Repeatable Read)

* Change (Read Committed)

* Cursor (Cursor Stability).

Socket Timeout (seconds)

The maximum wait time for socket-level operations before the connection attempt or data transfer is aborted.

Helps avoid indefinite hangs during connectivity or network delays. Default value 90 seconds.

Fetch Block Size

The number of rows the driver retrieves per network call during query result set retrieval.

Larger values can improve throughput for large result sets.

Maximum Rows

The maximum number of rows to retrieve from a result set. A value of 0 means no limit.

Use this to limit memory consumption when testing queries or working with large datasets.

Hold Cursors Across Commits

Controls whether cursors remain open across commits.

A setting of on retains active cursors after transaction commits; off closes them. Useful for applications that rely on cursor continuity.

Use Packages

Enable to use SQL packages for improved performance. If disabled, dynamic SQL is used.

Packages provide better performance by pre-compiling SQL statements. Recommended for production environments.

Package Library

The library where SQL packages are stored or created. Use <Default> for the default library.

Only applicable when Use Packages is enabled. Ensure the user has permissions to access or create packages in the specified library.

Package Name

The name of the SQL package to use. Use <Default> for the default package name.

Only applicable when Use Packages is enabled. Multiple applications can use different package names to avoid conflicts.

Allow Package Update

Enable to allow the driver to create or update SQL packages on the server if they do not exist or are outdated.

Requires CREATE PACKAGE privileges. Disable in read-only environments or when packages are managed externally.

Convert Date/Time

Enables automatic conversion of date/time formats between client and server representations.

Turning this off may require the client to handle formatting explicitly.

Remove Trailing Blanks

Indicates whether trailing blanks are trimmed from fixed-length character fields before returning data to the client.

Used at the end of a character field, for example, CHAR, VARCHAR, LONGVARCHAR.

Binary Characters

Enable to treat character data as binary. This prevents character conversion and can be useful for specific data types or when character set issues are encountered.

Use when dealing with binary data stored in character columns or to avoid encoding issues.

Use Unicode SQL

Enable to use Unicode (UCS-2) for SQL statements and data exchange. This is recommended for applications handling multi-language data.

Essential for supporting international character sets and avoiding data corruption in multi-lingual environments.

Connection Pooling

When enabled, connections are reused from a pool instead of opening a new connection for every request.

Pooling greatly improves performance in high-throughput environments.

Connection Lifetime
(required)

The amount of time a pooled connection is kept alive before being retired.

Helps avoid issues with stale connections and enforces periodic reconnection cycles.

Catalog Name

The name of the catalog to use for metadata queries. This can be used to filter the scope of database objects displayed.

Optional. Use when working with specific database catalogs or when you need to restrict metadata visibility.

Create a Connection