TechTip: Retrieve Data from Non-DB2 Databases

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

A popular question these days is "How can my iSeries programs access data in non-DB2 databases such as Oracle and SQL Server?"

The simple answer is that some additional middleware is required because not all database products support the Distributed Relational Database Architecture (DRDA).

DB2 UDB for iSeries (and the whole IBM DB2 UDB family) has long supported the DRDA standard for remote data access and interoperability. Today, iSeries customers can use DRDA to access the other DB2 products running on UNIX and Intel servers, but not third-party databases. Other database vendors, such as Oracle and Sybase, have actually delivered tools based on DRDA. Unfortunately, they have chosen to support only part of the standard. They implemented the DRDA specification that enables them to access data in other databases, but they don't support the DRDA specifications that would allow DRDA-compliant databases (e.g., DB2 UDB for iSeries) to access and update their data.

So what middleware options exist to enable iSeries programs to access non-DB2 data? There are both proprietary and industry standards out there. With the proprietary solutions, the request is typically an SQL statement, but it's passed in via a proprietary API. That API is not available on other platforms and may not be available to all programming languages (C, RPG, Java, etc.). These solutions work fine as long the proprietary interface is not an issue.

There are basically two standard solutions available to iSeries customers. If using Java is not an issue, you may want to consider finding a Type 4 JDBC driver for the non-DB2 database that you're trying to access. Since OS/400 includes a JVM, these Type 4 JDBC drivers can be loaded directly onto your iSeries server. Once the Type 4 JDBC driver is loaded, any iSeries Java application will be able to access that non-DB2 data with standard JDBC calls.

The other industry standard solution available to iSeries customers is the IBM DB2 Information Integrator (DB2 II) product. This product allows you to use any iSeries SQL interface (SQL embedded in RPG, JDBC, etc.) to access non-DB2 databases. Here's a sample of the embedded SQL that would be needed to read an Oracle table with DB2 Information Integrator from an iSeries application (assuming the necessary setup has been completed).

EXEC SQL CONNECT TO remotedb;
EXEC SQL SELECT custpref INTO :locpref FROM orcustomer WHERE custid=22;

DB2 Information Integrator does not run natively on OS/400; it requires a Windows or UNIX server. Running DB2 II on an Integrated xSeries Server would be a natural solution for most iSeries customers. To learn more about the IBM DB2 II solution, visit the DB2 Universal Database for iSeries Web site.

Kent Milligan is DB2 UDB Technology Specialist on IBM's eServer Solutions Enablement team. He spent the first seven years at IBM as a member of the DB2 development team in Rochester. He can be reached at This email address is being protected from spambots. You need JavaScript enabled to view it..

Kent Milligan
Kent Milligan is a Senior Db2 for i Consultant in the IBM Lab Services Power Systems Delivery Practice.  Kent has over 25 years of experience as a Db2 for IBM i consultant and developer working out of the IBM Rochester lab. Prior to re-joining the DB2 for i Lab Services practice in 2020, Kent spent 5 years working on healthcare solutions powered by IBM Watson technologies. Kent is a sought-after speaker and author on Db2 for i & SQL topics.
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: