Chapter 3. Connectivity with DB2 UDB for iSeries 37
Scenario 4 accesses DB2 UDB for Linux from OS/400 applications. The
OS/400 application program can access the database in Linux via an SQL
interface such as CLI (DB2 Call Level Interface), Embedded SQL, JDBC, or
SQLJ. You will find some examples in Appendix A, “Accessing DB2 UDB for
Linux from OS/400 application” on page 105.
Scenario 5 is the database replication between DB2 UDB for iSeries and
Linux. This scenario is possible when the Data Propagator is installed on
OS/400, and the DB2 UDB for Linux Enterprise Server Edition is installed.
This book focuses on Scenario 3. The various connectivity methods such as CLI,
ODBC, Embedded SQL, JDBC, and SQLJ of Scenario 3 are discussed and the
configuration samples and sample programs are provided.
3.2 DB2 Connect introduction
Again, our main focus is Scenario 3 and DB2 Connect is the key product
facilitating that scenario. Now we introduce DB2 Connect before we discuss
actual scenarios of the various access methods.
3.2.1 Overview
DB2 Connect is the product which enables Linux, UNIX or Windows applications
to access DB2 UDB for iSeries (OS/400) using DRDA (Distributed Relational
Database Architecture). It is an efficient facility to integrate DB2 UDB for iSeries
and DB2 UDB for Linux on iSeries.
Although there are other native methods to access DB2 UDB for iSeries from
Linux, such as ODBC or JDBC drivers, DB2 Connect is the only way to access
DB2 UDB for iSeries from Linux applications using DRDA.
Since it uses DRDA, users can access DB2 UDB for iSeries transparently as a
DB2 database. User application programs do not have to be aware that the
operating system is OS/400. It means that the same application programming
interface is provided to access DB2 UDB for iSeries and DB2 UDB for
Linux/UNIX/Windows (LUW).
Figure 3-2 introduces two basic elements of DRDA: Application Requester (AR)
and Application Server (AS). Again, the benefit of DRDA is your DB access to
applications can be transparent from DB serving platforms. The coordinated
functions of AR and AS hide the differences to the applications. When using a
distributed relational database, the system on which the application program
runs is called the application requester (AR), and the system on which the
38 DB2 UDB for Linux on iSeries: Implementation Guide
remote data resides is called the application server (AS). The term client is often
used interchangeably with AR, and
server with AS.
Figure 3-2 A distributed relational database
DB2 UDB for iSeries supports both AS and AR. In case of DB2 UDB for LUW,
only Enterprise Edition supports them both. Other editions only support AS and
you need to use DB2 Connect in case you need AR functionality.
Therefore, if your Linux applications want to access DB2 UDB for iSeries in a
DRDA manner, you will need DB2 Connect on the Linux side. For the reverse,
you don’t need DB2 Connect on the OS/400 side. Since DB2 UDB for LUW has
DRDA AS and DB2 UDB for iSeries has DRDA AR as their standard functions,
DB2 Connect is not necessary to access DB2 UDB for LUW.
DB2 Connect is included in DB2 UDB Enterprise Server Edition (ESE), or can be
purchased as a single product. Some other developer’s editions of DB2 UDB also
contain DB2 Connect facility. There are many editions of DB2 Connect which
provides various functionality, packaging, or licensing. But from the technical
view point, there are only two editions, Personal Edition and Enterprise Edition.
The DB2 Connect Personal Edition supports only the direct connection from the
machine DB2 Connect installed to DB2 UDB for iSeries. The Enterprise Edition
can support the intermediate connection between the DB2 clients and DB2 UDB
for iSeries as a gateway as illustrated in Figure 3-3. The DB2 client which
connects to DB2 Connect Enterprise Edition must have DB2 Client, formerly
known as DB2 Client Application Enabler (CAE) facility.
Get DB2 for Linux on iSeries: Implementation Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.