Environment, connection, and statement handles

When an application requests it, the driver and the driver manager allocate storage for information about the environment, each connection, and each SQL statement.

The driver returns a handle for each of these allocations to the application, which uses one or more handles in each call to a function.

The HCL OneDB™ ODBC Driver API uses the following types of handles:
Environment handles
Environment handles identify memory storage for global information, including the valid connection handles and the current active connection handle. The environment handle is an henv variable type. An application uses one environment handle. It must request this handle before it connects to a data source.
Connection handles
Connection handles identify memory storage for information about particular connections. A connection handle is an hdbc variable type. An application must request a connection handle before it connects to a data source. Each connection handle is associated with the environment handle. However, the environment handle can be associated with multiple connection handles.
Statement handles
Statement handles identify memory storage for information about SQL statements. A statement handle is an hstmt variable type. An application must request a statement handle before it submits SQL requests. Each statement handle is associated with exactly one connection handle. However, each connection handle can be associated with multiple statement handles.