IBM Books

Quick Beginnings for UNIX**


Working with DB2 Data

As well as providing a relational database to store your data, DB2 lets you issue requests to administer, query, update, insert, or delete data using local or remote client applications.

Accessing DB2 Data from Remote Clients

DB2 clients provide a run-time environment that enables client applications to access one or more remote databases. With a DB2 Administration Client, you can remotely administer DB2 or DB2 Connect servers. Local applications, and all Java applications (either local or remote), access a database through a DB2 client. All remote applications that are not Java applets must have a DB2 client installed on the client machine before they can access the remote database.

DB2 Version 6 clients are supported on:



Figure car not displayed.

DB2 clients for the following releases and platforms are available for download from the web:

  • DB2 Version 1.2 for DOS

  • DB2 Version 2.1 for Macintosh

  • DB2 Version 2.1 for SCO Open Server

  • DB2 Version 5.2 for SCO UnixWare 7

  • DB2 Version 2.1 for SINIX

  • DB2 Version 5.2 for Windows 3.1

To obtain these clients, connect to the IBM DB2 clients web site at http://www.software.ibm.com/data/db2/db2tech/clientpak.html

Figure 1 shows a server that is being accessed by local and remote applications. Remote applications must have the appropriate DB2 client installed to enable applications to access data on the remote server.

Figure 1. DB2 Server with Local Applications and Remote Clients


This is a diagram of all the remote clients that can connect to a DB2 Universal Database.

Accessing Multiple DB2 Servers

Once a network is operational and protocols are functional on all workstations, LAN-to-LAN connections between DB2 servers and clients require no additional software.

For example, you can have a server on a Windows NT workstation that is connected to a LAN, and another server on a UNIX workstation connected to a LAN. As long as there is a connection between the two LANs, clients on either network can access either server. See Figure 2.

Figure 2. Accessing Data on Multiple Servers


Diagram showing clients connecting to multiple DB2 servers.

Within a single transaction, databases on both servers are accessed and updated, and the integrity of the data on both servers is maintained. This is commonly known as two-phase commit, or distributed-unit-of-work access. Refer to the Administration Guide for more information.

Accessing Host or AS/400 DB2 Data from the Desktop Using DB2 Connect Enterprise Edition

A DB2 server with the DB2 Connect Server Support feature installed, or a DB2 Connect server, enables DB2 clients on a LAN access to data that is stored on host or AS/400 systems.

Figure hint not displayed.

DB2 Universal Database Enterprise Edition and DB2 Universal Database Enterprise - Extended Edition include the DB2 Connect Server Support component. All references to DB2 Connect Enterprise Edition also apply to the DB2 Connect Server Support component.

DB2 Connect Enterprise Edition is most appropriate for environments where:

Applications are provided with transparent access to host or AS/400 data through a standard architecture for managing distributed data. This standard is known as Distributed Relational Database Architecture (DRDA). Use of DRDA allows your applications to establish a fast connection to host and AS/400 databases without expensive host components or proprietary gateways.

A great deal of the data in many large organizations is managed by DB2 for AS/400, DB2 for MVS/ESA, DB2 for OS/390, or DB2 for VSE & VM. Applications that run on any of the supported platforms can work with this data transparently, as if a local database server managed it. DB2 Connect Enterprise Edition is required for supporting applications which access host or AS/400 data and exploit transaction monitors (for example, CICS, Encina, Microsoft Transaction Server) as well as applications that are implemented as Java applets. In addition, you can use a wide range of off-the-shelf or custom-developed database applications with DB2 Connect and its associated tools. For example, you can use DB2 Connect products with:

Although DB2 Connect is often installed on an intermediate server machine to connect DB2 clients to a host or AS/400 database, it is also installed on machines where multiple local users want to access the host or AS/400 servers directly. For example, DB2 Connect may be installed on a large machine with many local users. It may also be installed on a Web server, Transaction Processor (TP) monitor, or other 3-tier application server machines with multiple local SQL application processes and threads. In these cases, you can choose to install DB2 Connect on the same machine for simplicity, or on a separate machine to off-load CPU cycles.

A DB2 server with the DB2 Connect functionality installed, or a DB2 Connect server, enables multiple clients to connect to host or AS/400 data and can significantly reduce the effort that is required to establish and maintain access to enterprise data. Figure 3 illustrates IBM's solution for environments in which you want to use a DB2 client making an indirect connection to a host or AS/400 database server through DB2 Connect Enterprise Edition.

Figure hint not displayed.

In the example, you could replace the DB2 Connect server with a DB2 server that has the DB2 Connect Server Support component installed.

Figure 3. DB2 Connect Enterprise Edition


Diagram showing clients connection to host and AS/400 databases through DB2 Connect Enterprise Edition.

Accessing DB2 Data from the Web Using Java

Java Database Connectivity (JDBC) and Embedded SQL for Java (SQLJ) are provided with DB2 to allow you to create applications that access data in DB2 databases from the Web.

Programming languages containing embedded SQL are called host languages. Java differs from the traditional host languages C, COBOL, and FORTRAN, in ways that significantly affect how it embeds SQL:

The JDBC server and the DB2 client must reside on the same machine as the Web server. The JDBC server calls the DB2 client to connect to local, remote, host, and AS/400 databases. When the applet requests a connection to a DB2 database, the JDBC client opens a TCP/IP connection to the JDBC server on the machine where the Web server is running. See Figure 4 for an example of a Java-enabled browser accessing data from remote DB2 databases.

Figure 4. Accessing Data Stored on DB2 Using JDBC


Diagram showing clients using a Web browser to connect to DB2 Universal Database.

JDBC and SQLJ applications can be run from any system that has a DB2 client installed; a Web browser and a Web server are not required.

For more information on Java enablement, refer to the DB2 Java Enablement web page at http://www.software.ibm.com/data/db2/java/. For more information on the JDBC API, point your browser to http://splash.javasoft.com/.

Accessing DB2 Data from the Web Using Net.Data

Net.Data is provided with DB2 to allow you to create applications that access data in DB2 databases from the Web.

Use Net.Data to create applications that are stored on a Web server and viewable from any Web browser. While viewing these documents, users can either select automated queries or define new ones that retrieve the specified information directly from a DB2 database.

Automated queries do not require user input; they are links in an HTML document and, when selected, they trigger existing SQL queries and return the results from a DB2 database. These links can be triggered repeatedly to access current DB2 data. Customized queries require user input. Users define the search characteristics on the Web page by selecting options from a list or by entering values in fields. They submit the search by clicking on a push button. Net.Data uses the information that is supplied by the user to dynamically build a complete SQL statement, and it sends the query to the DB2 database.

A demonstration of Net.Data applications is available from the IBM Software Net.Datapage at http://www.software.ibm.com/data/net.data.

Net.Data can be installed with a DB2 server to allow local access to databases. Net.Datacan be installed with a DB2 client to allow remote access to databases. In both cases, Net.Data and the Web server must be installed on the same system. See Figure 5 for an example of a workstation with Net.Data that is being used to access data from a remote DB2 database.

Figure 5. Accessing Internet Data Stored on DB2 Using Net.Data


Diagram showing clients using a Web browser to connect to DB2 Universal Database.

Accessing DB2 Data from Host and AS/400 Client Machines

The DRDA Application Server (DRDA AS) functionality gives clients or applications on host and AS/400 machines transparent access to data stored on a LAN-based DB2 Universal Database server. This access is provided through Distributed Relational Database Architecture (DRDA), a standard architecture for managing data. You can configure your server to act as a DRDA AS for host and AS/400 clients or applications; these clients or applications are known as DRDA Application Requesters (DRDA AR).

Figure hint not displayed.

The DRDA AS feature is available for:

  • DB2 Universal Database Enterprise - Extended Edition

  • DB2 Universal Database Enterprise Edition

  • DB2 Workgroup Edition

For information on how to set up your DB2 Universal Database server as a DRDA AS, refer to the Installation and Configuration Supplement.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]