Skip to content

DRDA/DB2 Configuration Guide

DRDA/DB2 Configuration Guide

Comprehensive configuration reference for HeliosDB’s IBM DB2 DRDA protocol support.

Connection Configuration

DB2 CLP Connection

Terminal window
# Catalog remote database
db2 catalog tcpip node HELIOS remote localhost server 50000
db2 catalog database heliosdb at node HELIOS
# Connect
db2 connect to heliosdb user admin using password

Connection String

jdbc:db2://localhost:50000/heliosdb

Connection Parameters

ParameterTypeDefaultDescription
hoststringlocalhostServer hostname
portint50000DRDA protocol port
databasestringheliosdbDatabase name
userstring-Username
passwordstring-Password
currentSchemastring-Default schema
securityMechanismint3Security mechanism

JDBC Configuration

Basic Connection

import java.sql.*;
String url = "jdbc:db2://localhost:50000/heliosdb";
Properties props = new Properties();
props.put("user", "admin");
props.put("password", "password");
Connection conn = DriverManager.getConnection(url, props);

Connection Pool (HikariCP)

HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:db2://localhost:50000/heliosdb");
config.setUsername("admin");
config.setPassword("password");
config.setMaximumPoolSize(10);
config.addDataSourceProperty("currentSchema", "myschema");
config.addDataSourceProperty("progressiveStreaming", "2");
HikariDataSource ds = new HikariDataSource(config);

JDBC Properties

PropertyTypeDefaultDescription
currentSchemastring-Default schema
progressiveStreamingint2LOB streaming mode
queryTimeoutint0Query timeout (seconds)
commandTimeoutint0Command timeout
securityMechanismint3Security type
traceLevelint0JDBC trace level

Python (ibm_db) Configuration

Basic Connection

import ibm_db
conn_str = (
"DATABASE=heliosdb;"
"HOSTNAME=localhost;"
"PORT=50000;"
"PROTOCOL=TCPIP;"
"UID=admin;"
"PWD=password;"
)
conn = ibm_db.connect(conn_str, "", "")

Connection Options

conn_str = (
"DATABASE=heliosdb;"
"HOSTNAME=localhost;"
"PORT=50000;"
"PROTOCOL=TCPIP;"
"UID=admin;"
"PWD=password;"
"CURRENTSCHEMA=myschema;"
"QUERYOPTS=OPTIMIZE FOR 100 ROWS;"
)

Security Configuration

Password Authentication

// Clear text password
props.put("securityMechanism", "3");
props.put("user", "admin");
props.put("password", "password");

Encrypted Password

// Encrypted user ID and password
props.put("securityMechanism", "9");
props.put("user", "admin");
props.put("password", "password");

Kerberos Authentication

props.put("securityMechanism", "11");
props.put("KerberosServerPrincipal", "db2/server@REALM");

Security Mechanisms

CodeNameDescription
3CLEAR_TEXT_PASSWORDClear text password
7ENCRYPTED_PASSWORDEncrypted password only
9ENCRYPTED_USER_AND_PASSWORDBoth encrypted
11KERBEROSKerberos authentication

SSL/TLS Configuration

JDBC with SSL

String url = "jdbc:db2://localhost:50000/heliosdb:sslConnection=true;";
props.put("sslTrustStoreLocation", "/path/to/truststore.jks");
props.put("sslTrustStorePassword", "password");

SSL Properties

PropertyDescription
sslConnectionEnable SSL (true/false)
sslTrustStoreLocationPath to truststore
sslTrustStorePasswordTruststore password
sslKeyStoreLocationPath to keystore
sslKeyStorePasswordKeystore password

DRDA Protocol Settings

Protocol Level Configuration

SettingValuesDescription
Level 3BasicStandard operations
Level 4ExtendedStored procedures
Level 5AdvancedAll features

Flow Control

// Configure block size
props.put("blockingReadConnectionTimeout", "30");
props.put("maxRetriesOnError", "3");

Isolation Levels

Configuration

// Set isolation level
conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);

DB2 Isolation Levels

JDBC LevelDB2 SyntaxDescription
READ_UNCOMMITTEDWITH URUncommitted read
READ_COMMITTEDWITH CSCursor stability
REPEATABLE_READWITH RSRead stability
SERIALIZABLEWITH RRRepeatable read

SQL Syntax

-- Query with isolation
SELECT * FROM employees WITH UR;
SELECT * FROM employees WITH CS;
SELECT * FROM employees WITH RS;
SELECT * FROM employees WITH RR;

HeliosDB-Specific Settings

Server Configuration

heliosdb.toml
[drda]
enabled = true
port = 50000
bind = "0.0.0.0"
max_connections = 10000
[drda.auth]
password = "your_secure_password"
allow_kerberos = false
[drda.ssl]
enabled = false
keystore = "/path/to/keystore.jks"
keystore_password = "password"
[drda.protocol]
level = 5
code_page = "UTF-8"

Environment Variables

VariableDescription
HELIOSDB_DRDA_PORTDRDA protocol port
HELIOSDB_DRDA_PASSWORDAuthentication password
HELIOSDB_DRDA_SSL_ENABLEDEnable SSL

Performance Tuning

Fetch Size

Statement stmt = conn.createStatement();
stmt.setFetchSize(1000);
ResultSet rs = stmt.executeQuery("SELECT * FROM large_table");

Query Optimization

-- Optimize for N rows
SELECT * FROM employees
OPTIMIZE FOR 100 ROWS;
-- Fetch first N rows only
SELECT * FROM employees
FETCH FIRST 100 ROWS ONLY;

Connection Pooling

// Recommended pool settings for DB2
HikariConfig config = new HikariConfig();
config.setMaximumPoolSize(20);
config.setMinimumIdle(5);
config.setIdleTimeout(300000);
config.setMaxLifetime(1800000);
config.setConnectionTimeout(30000);

Related: README.md | COMPATIBILITY.md | EXAMPLES.md

Last Updated: December 2025