Table of Contents
1 What Is IBM Db2? 1
From the Mainframe to Distributed Platforms and the IBM Cloud 3
Db2 Today 3
2 Structured Query Language (SQL) 5
3 The Db2 Call Level Interface 9
4 Python and Db2 15
Installing the Python Interpreter 17
IBM Db2 Support for Python 18
5 Setting Up a Python-Db2 Development Environment 21
A Word About My Development Platform: the UDOO X86 22
Downloading the Db2 Software 23
Enabling root User Access (Ubuntu Linux Setup Only) 25
Preparing a Linux Server for Db2 Installation 25
Installing the Db2 Software 27
Building the SAMPLE Database 36
Installing the Db2 Python Library (Driver) 38
Summary 40
6 Building Python Applications That Work with Db2 41
Functionality Provided by the ibm_db and ibm_db_dbi Python Libraries 42
Special Objects Used by Db2-Python Applications 47
Establishing a Db2 Server or Database Connection 48
Transaction Processing: Executing SQL Statements 51
Transaction Processing: Retrieving Query Results 53
Transaction Processing: Obtaining Result Set Information 56
Transaction Processing: Terminating the Current Transaction 58
Calling Stored Procedures 60
Terminating a Db2 Server or Database Connection 61
Obtaining Information About a Data Source and Setting Driver Options 62
Diagnostics and Error Handling 63