← All databases

Database · native ODBC

Db2 for i into Apache Arrow with ADBC

Db2 for i 7.5 (IBM i, PUB400.COM public server), read and written through adbcBridge — the ADBC driver that loads the database's ODBC driver — verified on Linux and macOS arm64. Everything below is the compatibility matrix's record for this row.

Status

Linux✓ pass

PASS

macOS arm64✓ pass

PASS (DB2/400 SQL (via ODBC) 07.05.0015; IBM i Access ODBC for macOS 1.1.0.29, libcwbodbc.dylib 07.01.029, arm64 slice, installed to /Library/IBMiAccess by an administrator — the package has no unprivileged install and the driver aborts on sign-on without its message catalogues; PUB400.COM over the plain host-server ports, SSL=0, because this driver's TLS path segfaults inside SQLDriverConnect whenever pyarrow's libraries are loaded in the same process, bisected to that combination alone, see UPSTREAM.md; the Driver= value must stay within 35 characters here too)

Windows x64platform

driver unavailable: the IBM i Access Client Solutions Windows Application Package — the only carrier of cwbodbc.dll — is behind an IBM export-control review of the downloading IBM ID, still pending; the entry itself needs nothing else and runs the moment the package lands

Driver and connection string

ODBC driver
IBM i Access ODBC 1.1.0.29 (libcwbodbc.so 07.01.029, IBM i host servers)
Wire
native ODBC
adbcBridge
0.1.1 (release)

The connection string the matrix used, as the connection strings reference records it (Databases with their own native protocol and ODBC driver); {drv} is the driver library or its name from odbcinst.ini, and the host, port and credentials are the test server's.

Driver={drv};System=<host>;UID=<user>;PWD=<password>;SSL=1;Naming=0;CommitMode=0;DefaultLibraries=<library>;

Python

import adbcbridge

# {drv}: the ODBC driver library (path), or its name from odbcinst.ini
conn = adbcbridge.connect(uri="Driver={drv};System=<host>;UID=<user>;PWD=<password>;SSL=1;Naming=0;CommitMode=0;DefaultLibraries=<library>;")
with conn.cursor() as cur:
    cur.execute("SELECT * FROM my_table")
    table = cur.fetch_arrow_table()      # pyarrow.Table

Polars and pandas

import polars as pl, pandas as pd

df = pl.read_database("SELECT * FROM my_table", connection=conn)   # Polars, Arrow-native
pdf = pd.read_sql("SELECT * FROM my_table", conn)                   # pandas 2.2+, ADBC connection

pip install adbcbridge brings the driver library; the Db2 for i ODBC driver is installed the way its vendor documents, then named in Driver=. Rust, Go, C# and Java use the same connection string through their ADBC driver managers — see the docs.

What the matrix recorded

a different engine and a different wire from the Db2 row above, not DRDA: IBM's own IBM i Access driver on the host-server ports, SQL_DBMS_NAME "DB2/400 SQL" 07.05.0015. Hosted — IBM i runs on Power hardware, there is no container and no emulator, and the entry points at PUB400.COM, the free public IBM i (PUB400_HOST/PUB400_USER/PUB400_PASSWORD; big_rows 3,000, one connection at a time).

What this stack needed

Read next