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

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

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 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 1 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 1. DB2 Connect Enterprise Edition


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

Figure 2. Using Transaction Monitors with DB2 Connect


Transaction monitors such as Encina work with DB2 Connect

Figure 3. Java Server Support


Websphere and Java server functionality in DB2 Connect

Figure 4. DB2 Connect working with Microsoft IIS


Microsoft IIS server with DB2 Connect

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.

Figure 5. Using Java Applets


JDBC and DB2 Connect

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.

Figure 6. Net.Data with DB2 Connect


Net.Data working with DB2 Connect


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

[ DB2 List of Books | Search the DB2 Books ]