Docs / IBM Db2 and ODBC (Windows)

← Databases

IBM Db2 and ODBC (Windows)

Db2, and any database with an ODBC driver or a data source (DSN), are reached through the system's ODBC driver manager. This works on Windows only for now: on macOS and Linux a Db2 or ODBC connection says that ODBC drivers are reached on Windows only.

First use: IBM's ODBC driver (Db2)

When you choose IBM Db2 for a new connection and no IBM ODBC driver is registered on this machine, a popup opens over the form: IBM Db2 needs IBM Data Server Driver for ODBC and CLI. It shows the package (version 12.1.4), its size, IBM's terms and where it comes from, and checks the download against a SHA-256. Download and install fetches it into the app's data folder and registers it with db2cli install -setup; Windows asks for administrator permission (User Account Control) to do that. Cancel leaves the form usable, and the offer returns at Test connection and at the first opening.

A driver already in the system counts: the app looks for one named IBM DB2 ODBC DRIVER… or IBM DATA SERVER…, whether its own registration or a full IBM client made it, and takes the newest by name. The connection's driver option replaces that choice. Settings › Drivers lists and removes the downloaded driver, and shows the ODBC drivers and data sources of the system.

Connect

IBM Db2: host, port (50000 by default), database (both host and database are required), user and password. The app builds the connection string itself (DATABASE, HOSTNAME, PORT, PROTOCOL=TCPIP, UID, PWD). TLS: the modes disable and prefer connect without it; require and above add Security=SSL, and sslrootcert becomes SSLServerCertificate. Db2 servers listen for TLS on another port than the plain one, so set the port. Through an SSH tunnel the tunnel's local end is used.

Other ODBC driver (the generic choice): give one of

The user and password fields are added as UID and PWD unless the string already has them. A pasted ADO.NET or ODBC string with Driver={…} is read into the matching form when the driver is SQL Server, PostgreSQL, MySQL/MariaDB or ClickHouse; any other driver or a DSN= becomes a generic ODBC connection with the string as it is.

Privileges

Whatever the database login has. The navigator uses ODBC's catalog calls (SQLTables, SQLColumns, SQLPrimaryKeys, SQLForeignKeys). There are no administration tabs.

What works

What does not

Agents

Read-only agents rely on the statement check alone. See Agents and the CLI.

Known limits

Tested on

The generic ODBC driver is run against SQL Server 2022 through Windows' own SQL Server driver: types, long results, errors with their SQLSTATE, metadata, commit and rollback, cancel of a waiting statement, SQL Server's own literals and types, and imports. IBM Db2 is not tested against a server.

See also: Connecting, Troubleshooting.