Drivers

DB2 for i (AS/400) Driver Documentation

This documentation explains the DB2 for i driver implementation and how connection parameters map to UI fields in the Gigantic application.

Connection Parameters

UI FieldTechnical ImplementationDescriptionRequiredDefault Value
Hosthost in odbc connection stringThe hostname or IP address of the DB2 for i serverYeslocalhost
PortPart of connection string in odbc configThe port number DB2 for i server is listening onYes50000 (from driverPorts)
DatabasePart of connection string in odbc configThe name of the database/library to connect toNoNone (defaults to user's library)
SchemadbSchema in gigadb configThe schema/library to use for queries and metadata extractionYesNone (must be specified)
Usernameuser in odbc connection configDatabase user for authenticationYesNone (must be specified)
Passwordpassword in odbc connection configPassword for the database userYesNone (must be specified)

Technical Details

The DB2 for i driver implementation uses the odbc Node.js library with custom wrapper functionality for IBM iSeries connections.

Key technical aspects:

  • Connection pooling is supported through the pooled flag in configuration
  • Uses IBM i Access ODBC Driver for connectivity
  • Schema/library selection is critical and affects all query generation
  • The driver uses QSYS2 system tables for metadata extraction (SYSTABLES, SYSCOLUMNS2, SYSINDEXES)
  • Constraint management is implemented using system procedures like QSYS2.CREATE_CONSTRAINT_INFO
  • Journaling and locking capabilities specific to IBM i are supported

When SSH tunneling is enabled, connections are first established through the tunnel before connecting to the DB2 for i server.

Connection String Format

DB2 for i connections are built using ODBC connection strings with the IBM i Access ODBC Driver:

DRIVER=IBM i Access ODBC Driver;SYSTEM=[host];PORT=[port];UID=[user];PWD=[password];

Additional ODBC connection parameters can be specified through configuration options.

Authentication Options

DB2 for i supports several authentication types:

Auth TypeUI MappingDescription
NoneNot applicable for DB2iDB2i always requires authentication
PasswordUsername/Password fieldsStandard username/password authentication
Password ManagerVarious password manager fieldsFetches credentials from external password managers

SSH Tunnel Support

The DB2 for i driver supports SSH tunneling for secure access to databases behind firewalls or in private networks. For detailed information on configuring SSH tunnels, please refer to the SSH Tunnelling documentation.

API Endpoints Used

DB2 for i connections are primarily used in:

  • Tap creation (data source discovery)
  • Sink creation (data destination for anonymized data)
  • Pipeline execution (data extraction and loading)

Custom Params

The DB2 for i driver supports additional custom parameters that can be specified in YAML format to fine-tune connection behavior, pooling, and other advanced options.

ODBC Connection Parameters

# Basic connection parameters
# Connection Behavior
CONNTYPE: 1  # Connection type: 0=Default, 1=Primary, 2=Secondary
SORTTYPE: 2  # Sort type: 0=System, 1=Hex, 2=Table
SORTWEIGHT: 1  # Sort weight: 0=Case insensitive, 1=Case sensitive
LANGUAGEID: "ENU"  # Language ID for national language support

# Performance Options
MAXBUFLEN: 32767  # Maximum buffer length for column data
LOBThreshold: 32767  # Threshold for LOB data handling
BLOCKING: 100  # Number of rows to fetch per request

# Security Options
ALLOWNULL: false  # Allow NULL values in result sets
DEBUG: false  # Enable debug mode for connection
SECURITY: "SSL"  # Security protocol (SSL, TLS, etc.)

# Timeout Settings
loginTimeout: 30  # Login timeout in seconds
queryTimeout: 60  # Query timeout in seconds
connectionTimeout: 30  # Connection establishment timeout

Connection Pool Parameters

# Pool configuration
pooled: true
poolMin: 0
poolMax: 10
poolIncrement: 1
poolTimeout: 60  # Pool timeout in seconds

Example Configurations

Basic Configuration

pooled: true
CONNTYPE: 1

SSL Configuration

SECURITY: "SSL"
ValidateServerCertificate: true

Advanced Configuration with Performance Tuning

CONNTYPE: 1
SORTTYPE: 2
BLOCKING: 500
LOBThreshold: 65536
queryTimeout: 300
pooled: true
poolMax: 20