Considerations for using distributed relational database

This section contains information that may be useful in developing applications that use application servers which are not the same product as their application requesters.

All DB2 Universal Database™ products support extensions to IBM® SQL. Some of these extensions are product-specific, but many are already shared by more than one product or support is planned but not yet generally available.

For the most part, an application can use the statements and clauses that are supported by the database manager of the current server, even though that application might be running through the application requester of a database manager that does not support some of those statements and clauses. Restrictions to this general rule are identified by application requester:

Note that an 'R' in the table indicates that this SQL function is not supported in the specified environment. An 'R' in every column of the same row means that the function is available only if the current server and requester are the same product or that the statement is blocked by the application requester from being processed at the application server.

Table 84. DB2 UDB for z/OS Application Requester
SQL Statement or Function DB2 UDB for z/OS Application Server DB2 UDB for iSeries Application Server DB2 UDB LUW Application Server
COMMIT HOLD R R R
DECLARE STATEMENT
DECLARE TABLE
DECLARE VARIABLE
DESCRIBE TABLE R
DESCRIBE with USING clause R
DISCONNECT R R R
BIGINT Data Types R 98 98
ROWID Data Types R
DATALINK Data Types R R R
BINARY and VARBINARY Data Types R R R
Host declarations not documented in language specific appendices 99 99
PREPARE with USING clause R
ROLLBACK HOLD R R R
SET CURRENT PACKAGESET
SET variable R R
SET TRANSACTION R R R
Scrollable Cursor statements R R R
UPDATE cursor - FOR UPDATE clause not specified
Table 85. DB2 UDB for iSeries Application Requester
SQL Statement or Function DB2 UDB for z/OS Application Server DB2 UDB for iSeries Application Server DB2 UDB LUW Application Server
COMMIT HOLD R R
DECLARE STATEMENT
DECLARE TABLE
DECLARE VARIABLE
DESCRIBE TABLE R
DESCRIBE with USING clause R
DISCONNECT
Host Variables - optional colon R R R
BIGINT Data Types R
ROWID Data Types R
DATALINK Data Types R R
BINARY and VARBINARY Data Types R R
Host declarations not documented in language specific appendices 99 99
PREPARE with USING clause R
ROLLBACK HOLD R R
SET CURRENT PACKAGESET R R R
SET variable R R R
SET TRANSACTION R R
Scrollable Cursor statements R R
UPDATE cursor - FOR UPDATE clause not specified R
Table 86. DB2 UDB LUW Application Requester
SQL Statement or Function DB2 UDB for z/OS Application Server DB2 UDB for iSeries Application Server DB2 UDB LUW Application Server
COMMIT HOLD R R R
DECLARE STATEMENT R R R
DECLARE TABLE R R R
DECLARE VARIABLE R R R
DESCRIBE TABLE R R R
DESCRIBE with USING clause R R R
DISCONNECT
Host Variables - optional colon R R R
BIGINT Data Types R
ROWID Data Types 100 100 R
DATALINK Data Types R R R
BINARY and VARBINARY Data Types R R R
Host declarations not documented in language specific appendices 99 99
PREPARE with USING clause R R R
ROLLBACK HOLD R R R
SET CURRENT PACKAGESET
SET variable R R R
SET TRANSACTION R R R
Scrollable Cursor statements R R R
UPDATE cursor - FOR UPDATE clause not specified R

CONNECT (Type 1) and CONNECT (Type 2) differences

There are two types of CONNECT statements. They have the same syntax, but they have different semantics:

The following table summarizes the differences between CONNECT (Type 1) and CONNECT (Type 2) rules:

Table 87. CONNECT (Type 1) and CONNECT (Type 2) Differences
Type 1 Rules Type 2 Rules
CONNECT statements can only be executed when the activation group is in the connectable state. No more than one CONNECT statement can be executed within the same unit of work. There are no rules about the connectable state. More than one CONNECT statement can be executed within the same unit of work.
If the CONNECT statement fails because the server name is not listed in the local directory, the connection state of the activation group is unchanged.

If a CONNECT statement fails because the activation group is not in the connectable state, the SQL connection status of the activation group is unchanged.

If a CONNECT statement fails for any other reason, the activation group is placed in the unconnected state.

If a CONNECT statement fails, the current SQL connection is unchanged and any subsequent SQL statements are executed by the current server.
CONNECT ends all existing connections of the activation group. Accordingly, CONNECT also closes any open cursors for that activation group. CONNECT does not end connections and does not close cursors.
A CONNECT to the current server will succeed if the application group is the connectable state. A CONNECT to an existing SQL connection of the activation group is an error. Thus, a CONNECT to the current server is an error.

Determining the CONNECT rules that apply

A program preparation option is used to specify the type of CONNECT that will be performed by a program. The program preparation option is specified using the RDBCNNMTH parameter on the CRTSQLxxx command.

Connecting to servers that only support remote unit of work

CONNECT (Type 2) connections to application servers that only support remote unit of work might result in connections that are read-only.

If a CONNECT (Type 2) is performed to an application server that only supports remote unit of work101:

If a CONNECT (Type 2) is performed to an application server that supports distributed unit of work:


98.
The DB2 UDB for z/OS Application Server application requester will process a BIGINT data type at the application server using the compatible DECIMAL(19,0) data type.
99.
The statement is supported if the application requester understands it.
100.
The DB2 UDB LUW application requester will process a ROWID data type at the application server using the compatible VARCHAR(40) FOR BIT DATA data type.
101.
DB2 UDB for iSeries using the initial DRDA® support for native TCP/IP is an example of an application server that supports only remote unit of work.



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