Distributed SQL application flow for TCP/IP connections

When the application program (the requester) issues the first SQL statement that references a remote database system, a connection must be established with the remote database system (the server).

The TCP/IP connect socket call is used to establish a conversation.

The requester's Db2 system issues the READ call to tell the server that it is waiting for an answer to the SQL statement.

Once the connection is established, the local Db2 system builds a message that represents the application's SQL statement. The WRITEV call is used to send the SQL statement to the server for processing.

When the application program terminates, a CLOSE call is issued by the requesting database to tell the database server that the distributed database application is complete. The CLOSE call tells the server that the application is complete.