Skip to content
Skills Library
Data & analytics · Tool integration

aidp-db2

/aidp-db2

Read or write IBM Db2 from an AIDP notebook through the AIDP `aidataplatform` Spark format handler. Use when the user mentions DB2, IBM Db2, LUW, or `type=DB2`. Auth is host/port + database name + user/password.

Licence
UPL-1.0
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

UPL-1.0, otwarta.

What it does and when to use it

Read or write IBM Db2 from an AIDP notebook through the AIDP `aidataplatform` Spark format handler. Use when the user mentions DB2, IBM Db2, LUW, or `type=DB2`. Auth is host/port + database name + user/password.

Original author description

Read or write IBM Db2 from an AIDP notebook through the AIDP `aidataplatform` Spark format handler. Use when the user mentions DB2, IBM Db2, LUW, or `type=DB2`. Auth is host/port + database name + user/password.

How it works

  1. When to use
  2. When NOT to use
  3. Ingestion read
  4. Ingestion write
  5. Pushdown SQL
  6. Gotchas
  7. References
Original SKILL.md headings · 76 lines, 206 words
SKILL.md preview
---
name: aidp-db2
description: Read or write IBM Db2 from an AIDP notebook through the AIDP `aidataplatform` Spark format handler. Use when the user mentions DB2, IBM Db2, LUW, or `type=DB2`. Auth is host/port + database name + user/password.
allowed-tools: Read, Write, Edit, Bash
---

# `aidp-db2` — IBM Db2 via AIDP `aidataplatform`

Use the built-in AIDP Db2 connector (`type=DB2`) for ingestion reads, writes, and SQL pushdown. External-catalog support is not included in the 4.1 release.

## When to use

- Read from or write to an IBM Db2 database from an AIDP notebook.
- Mentioned: "DB2", "Db2", "IBM Db2", or `type=DB2`.

## When NOT to use

- For a database without a dedicated AIDP connector → [`aidp-jdbc-custom`](../aidp-jdbc-custom/SKILL.md).
- For a Db2 external-catalog request; that capability is not available in 4.1.

## Ingestion read

```python
import os
from oracle_ai_data_platform_connectors.aidataplatform import (
    AIDP_FORMAT, aidataplatform_options,
)

opts = aidataplatform_options(
    type="DB2",
    host=os.environ["DB2_HOST"],
    port=int(os.environ.get("DB2_PORT", "50000")),
    database_name=os.environ["DB2_DATABASE"],
    user=os.environ["DB2_USER"],
    password=os.environ["DB2_PASSWORD"],
    schema=os.environ["DB2_SCHEMA"],
    table=os.environ["DB2_TABLE"],
)
df = spark.read.format(AIDP_FORMAT).options(**opts).load()
df.show(5)
```

## Ingestion write

`CREATE`, `APPEND`, `OVERWRITE`, and `MERGE` are supported. `write.merge.keys` is required for `MERGE`.

```python
write_opts = aidataplatform_options(
    type="DB2",
    host=os.environ["DB2_HOST"],
    port=int(os.environ.get("DB2_PORT", "50000")),
    database_name=os.environ["DB2_DATABASE"],
    user=os.environ["DB2_USER"],
    password=os.environ["DB2_PASSWORD"],
    schema=os.environ["DB2_SCHEMA"],
    table=os.environ["DB2_TARGET_TABLE"],
    extra={"write.mode": "CREATE"},
)
df.write.format(AIDP_FORMAT).options(**write_opts).save()
```

## Pushdown SQL

```python
pushdown_df = (spark.read.format(AIDP_FORMAT)
    .options(**opts)
    .option("pushdown.sql", "SELECT * FROM <SCHEMA>.<TABLE_NAME> FETCH FIRST 10 ROWS ONLY")
    .load())
pushdown_df.show(5)
```

## Gotchas

- Use `DB2`, not the generic JDBC connector type.
- `database.name` is required for Db2.
- Db2 external-catalog access is not included in the 4.1 release.

## References

- Official sample: [Db2 notebook](https://github.com/oracle-samples/oracle-aidp-samples/blob/main/data-engineering/ingestion/Read_Write_External_Ecosystem_Connectors/DB2.ipynb)

Versions

The database has no other skills named aidp-db2.

Identical content appears in 2 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version d90d428ea94f (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100aidp-sqlserver
    Read or write Microsoft SQL Server from an AIDP notebook via the AIDP `aidataplatform` Spark format handler. Use when the user mentions SQL Server, MSSQL, or has a TDS host/port. Auth is host/port + database + user/password.
  • 100aidp-azuresql
    Read or write Azure SQL Database from an AIDP notebook through the AIDP `aidataplatform` Spark format handler. Use when the user mentions Azure SQL, Azure SQL Database, AZURE_SQLSERVER, or a database.windows.net endpoint. Auth is SQL username/password.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.