You are currently on IBM Systems Media’s archival website. Click here to view our new website.


Accessing DB2 Data Using DRDA


I recently needed to use a clients iSeries* system to access data residing on a WebSphere* Commerce Server (WCS) system. The front end of the clients e-commerce application runs on Intel* servers running Windows* Server 2000, WebSphere Application Server (WAS), WCS Express and WebSphere MQ (WMQ) Express. The WCS system communicates with a back-end business process via WMQ, sending and receiving data from the WCS DB2* Universal Database* (UDB) and the iSeries DB2 database.


The clients help desk needed to obtain address information from individual customer orders stored in WCS but not transferred to the back-end system. My first thought was to use FTP to transfer information nightly from the WCS system to the iSeries system. However, I rejected that idea because of the lack of immediacy. I could've scripted a batch solution, but it wouldn't provide current information. Since I was communicating with a relational database, I also contemplated using an ODBC or JDBC solution. While this would provide current information, Id have to write Java* code on the iSeries system.


I wanted to use a utility like the Start SQL Interactive Session (STRSQL) command. This produces a prompt (not unlike the Command Entry screen) from which you can enter SQL commands (e.g., SELECT, DELETE or CONNECT TO). CONNECT TO is what I needed-this offers the capability to connect to a remote database, in this case DB2 on the WCS server.


The capability to run interactive SQL commands on the iSeries system to connect to DB2 databases on other platforms is a result of IBMs support of the Distributed Relational Database Architecture (DRDA). DRDA is similar to ODBC or JDBC-as with ODBC or JDBC, specific interfaces (usually provided by the database vendor) must be written to use it. Since DRDA is an IBM standard, DB2 databases have the support built in.


Making the Connection

I took these steps to connect the iSeries DB2 database to the WCS DB2 database. First, I created a relational database entry on the iSeries system using the Work with Relational Database Directory Entries (WRKRDBDIRE) command. Figure 1 shows an example of the display presented with this command.


When the display presents itself, notice that there's already an entry. A default entry for the local system (*LOCAL) should be present. To add a relational database directory entry, select Option 1 and specify the relational databases name. (Note: This is the name of the database on the remote system. This is a two-part parameter. You can also specify an alias for the database name; this can be important if the same database name exists on multiple servers.) Figure 2 (below) shows the display for adding a new entry.



The capability to run interactive SQL commands on the iSeries system to connect to DB2 databases on other platforms is a results of IBM's support of the Distributed Relational Database Architecture (DRDA).

Michael Ryan is a technical editor with IBM Systems Magazine. Michael can be reached at



2019 Solutions Edition

A Comprehensive Online Buyer's Guide to Solutions, Services and Education.


Analyzing Disk Watcher Data

Knowing how to collect and analyze your performance data can help improve your system’s performance

An Introduction to Job Watcher Green-Screen Commands

Although Job Watcher now has a GUI, green screeners won’t be left out with four new green-screen commands.

IBM Systems Magazine Subscribe Box Read Now Link Subscribe Now Link iPad App Google Play Store
IBMi News Sign Up Today! Past News Letters