Airflow Summit 2026 is coming August 31 - September 2 in Austin, TX. Register now to secure your spot!

tests.system.ibm.db2.example_db2

Example Dag demonstrating the Db2 Provider.

This Dag shows how to use the Db2 provider for common database operations:

  • Using SQLExecuteQueryOperator with Db2Hook for SQL execution

  • Using Db2Hook for programmatic queries

  • Creating tables and inserting data

  • Querying and processing results

Prerequisites:

  1. Install the Db2 provider: pip install apache-airflow-providers-ibm-db2

  2. Configure a Db2 connection in the Airflow UI or set the environment variable AIRFLOW_CONN_DB2_DEFAULT='db2://user:password@host:port/database'

Attributes

test_run

Functions

cleanup_tables()

Drop tables if they exist to ensure clean state.

Module Contents

tests.system.ibm.db2.example_db2.cleanup_tables()[source]

Drop tables if they exist to ensure clean state.

tests.system.ibm.db2.example_db2.test_run[source]

Was this entry helpful?