Client-to-server communications

Configuring client-to-server communications for the IBM® data server client and Db2® database server products requires and understanding of the components and type of connections.

Components and scenarios

The basic components involved in client-to-server communications are described in the following section:

  • Client. This refers to the initiator of the communications. This role can be filled by any of the following Db2 products or components:
    • IBM Data Server Driver Package
    • IBM Data Server Client or IBM Data Server Runtime Client.
    • Db2 Connect: This product is a superset of the IBM Data Server Client.
    • a Db2 server product: A Db2 server is a superset of the Data Server Client.
  • Server. This refers to the receiver of the communications request from the client. This role is normally filled by a Db2 server product. When Db2 Connect products are present, the term server can also mean a Db2 server on a midrange or mainframe platform.
  • Communications protocol. This refers to the protocol used to send data between the client and server. The Db2 product supports several protocols:
    • TCP/IP. A further distinction can be made between the version: TCP/IPv4 or TCP/IPv6.
    • Named Pipes. This option is available on Windows only.
    • IPC (interprocess communications). This protocol is used for local connections.
There are also some additional components encountered in some environments:
  • Db2 Connect gateway. This refers to a Db2 Connect server product that provides a gateway by which IBM data server client can connect to Db2 servers on midrange and mainframe products.
  • LDAP (Lightweight Directory Access Protocol). In an LDAP-enabled environment, it is not necessary to configure client-to-server communications. When a client attempts to connect to a database, if the database does not exist in the database directory on the local machine then the LDAP directory is searched for information required to connect to the database.
The following scenarios illustrate examples of situations covered by client-to-server communications:
  • Data Server Client establishes communications with a Db2 server using TCP/IP.
  • Data Server Runtime Client establishes communications with a Db2 server using Named Pipes on a Windows network.
  • Db2 server establishes communications with another Db2 server via some communications protocol.
  • Data Server Client establishes communications with a mainframe Db2 server via a Db2 Connect server using TCP/IP.

When setting up a server to work with development environments (such as IBM Data Studio), you might encounter error message SQL30081N at the initial Db2 connection. A possible root cause is that the firewall at the remote database server has prevented the connection from being established. In this case, verify the firewall is properly configured to accept connection requests from the client.

Types of connections

Generally speaking, references to setting up client-to-server communications refer to remote connections, rather than local connections.

A local connection is a connection between a database manager instance and a database managed by that instance. In other words, the CONNECT statement is issued from the database manager instance to itself. Local connections are distinctive because no communications setup is required and IPC (interprocess communications) is used.

A remote connection is one where the client issuing the CONNECT statement to a database is in a different location from the database server. Commonly, the client and server are on different machines. However, remote connections are possible within the same machine if the client and server are in different instances.

Another less common type of connection is a loopback connection. This is a type of remote connection where the connection is configured from a Db2 instance (the client) to the same Db2 instance (the server).

Configuration of client-to-server communications

You can configure client-to-server communications by using the command line tools which consist of the Command Line Processor (CLP), the db2cfexp (configuration export) command, and the db2cfimp (configuration import) command.

Use the following table to identify the appropriate configuration method.

Table 1. Tools and methods for configuring a client-to-server connection
Type of configuration task CLP
Configure a client by entering information manually Configure client-to-server connections by using the CATALOG TCPIP/TCPIP4/TCPIP6 NODE command and the CATALOG DATABASE command.
Use the connection settings for one client as the basis for configuring additional clients
  1. Create a client profile by issuing the db2cfexp command.
  2. Configure database connections using a client profile by issuing the db2cfimp command.
Note: Use Profiles to configure client-to-server communications. The types of profiles are:
  • A client profile is a file that contains settings for a client. Settings can include:
    • Database connection information (including CLI or ODBC settings).
    • Client settings (including database manager configuration parameters and Db2 registry variables).
    • CLI or ODBC common parameters.
  • A server profile is similar to a client profile but contains settings for a server.

In IBM Data Studio Version 3.1 or later, you can use the task assistant for configuring automatic maintenance. Task assistants can guide you through the process of setting options, reviewing the automatically generated commands to perform the task, and running these commands. For more details, see Administering databases with task assistants.