SQL Reference

Distributed Relational Database

A distributed relational database consists of a set of tables and other objects that are spread across different but interconnected computer systems. Each computer system has a relational database manager to manage the tables in its environment. The database managers communicate and cooperate with each other in a way that allows a given database manager to execute SQL statements on another computer system.

Distributed relational databases are built on formal requester-server protocols and functions. An application requester supports the application end of a connection. It transforms a database request from the application into communication protocols suitable for use in the distributed database network. These requests are received and processed by an application server at the other end of the connection. Working together, the application requester and application server handle the communication and location considerations so that the application is isolated from these considerations and can operate as if it were accessing a local database. A simple distributed relational database environment is illustrated in Figure 3.

Figure 3. A Distributed Relational Database Environment


REQTEXT

For more information on Distributed Relational Database Architecture (DRDA) communication protocols, see Distributed Relational Database Architecture Reference SC26-4651.

Application Servers

An application process must be connected to the application server of a database manager before SQL statements that reference tables or views can be executed. A CONNECT statement establishes a connection between an application process and its server. 9 The server can change when a CONNECT statement is executed.

The application server can be local to or remote from the environment where the process is initiated. (An application server is present, even when not using distributed relational databases.) This environment includes a local directory that describes the application servers that can be identified in a CONNECT statement. For a description of local directories, see the Administration Guide

To execute a static SQL statement that references tables or views, the application server uses the bound form of the statement. This bound statement is taken from a package that the database manager previously created through a bind operation.

For the most part, an application can use the statements and clauses that are supported by the database manager of the application server to which it is currently connected, even though that application might be running via the application requester of a database manager that does not support some of those statements and clauses.

For information about using an application server to submit queries in a system of distributed data sources, see Server Definitions and Server Options.

CONNECT (Type 1) and CONNECT (Type 2)

There are two types of CONNECT statements:


Footnotes:

9
DB2 CLI and embedded SQL support a connection mode called concurrent transactions which supports multiple connections, each of which is an independent transaction. An application can have multiple concurrent connections to the same database. Refer to the Application Development Guide for details on multiple thread database access.


[ Top of Page | Previous Page | Next Page ]