Overview of the CLI application initialization and termination phases
Figure 1 shows the common function call sequences for both the initialization and termination phases.
In the initialization phase, all CLI application must allocate and initialize the environment, statement, and connection handles with the SQLAllocHandle() function. An environment handle and statement handle must be allocated before a connection handle can be created. When the handles are allocated, connection can be established to the target database in the initialization phase.
The transaction processing phase in the middle of the diagram is described in the Transaction processing in CLI overview topic.
The termination phase consists of disconnecting from the data source and freeing those handles that were allocated during the initialization phase. The connection handle must be freed before the environment handle.
