SQLFreeConnect() invalidates and frees the connection handle. All DB2® UDB CLI resources associated with the connection handle are freed.
SQLDisconnect() must be called before calling this function.
Either SQLFreeEnv() is called next to continue terminating the application, or SQLAllocHandle(), to allocate a new connection handle.
SQLRETURN SQLFreeConnect (SQLHDBC hdbc);
Data type | Argument | Use | Description |
---|---|---|---|
SQLHDBC | hdbc | Input | Connection handle |
If this function is called when a connection still exists, SQL_ERROR is returned, and the connection handle remains valid.
SQLSTATE | Description | Explanation |
---|---|---|
58004 | System error | Unrecoverable system error. |
HY001 | Memory allocation failure | The driver is unable to allocate memory required to support the processing or completion of the function. |
HY010 | Function sequence error | The function is called before SQLDisconnect() for the hdbc. |
HY013 * | Memory management problem | The driver is unable to access memory required to support the processing or completion of the function. |
Refer to the example in SQLAllocEnv().