ODBC/MX Driver for Windows Manual (SQL/MX 2.x)

ODBC/MX Client Overview
HP NonStop ODBC/MX Driver for Windows527888-004
1-5
Enabling Connection Pooling
To use connection pooling, an ODBC client application must perform the following
sequence:
Step Client Action
1. Enable connection
pooling
Call SQLSetEnvAttr with the environment handle set to NULL
and the SQL_ATTR_CONNECTION_POOLING attribute set
to SQL_CP_ONE_PER_DRIVER or
SQL_CP_ONE_PER_HENV.
SQL_CP_OFF (the default) turns connection pooling off.
2. Allocate an environment
handle
Call SQLAllocHandle with the HandleType argument set to
SQL_HANDLE_ENV.
3. Specify how the ODBC
driver manager should
match an incoming
connection with the
connections in the pool
Call SQLSetEnvAttr and set the SQL_ATTR_CP_MATCH
attribute to SQL_CP_STRICT_MATCH (the default) or
SQL_CP_RELAXED_MATCH.
4. Specify the ODBC
version
Call SQLSetEnvAttr and set the
SQL_ATTR_ODBC_VERSION attribute to the application
version (for example, SQL_OV_ODBC3).
5. Allocate a connection
handle
Call SQLAllocHandle with the HandleType argument set to
SQL_HANDLE_DBC, and the InputHandle argument set to
the environment handle allocated for connection pooling.
6. Make the connection Call SQLConnect or SQLDriverConnect. The driver manager
uses the connection options and the
SQL_ATTR_CP_MATCH attribute to determine which
connection in the pool to assign to the application.
7. Set connection attributes Call SQLSetConnectAttr to set these attributes if necessary:
SQL_ATTR_TXN_ISOLATION
(default: SQL_TXN_READ_COMMITTED)
SQL_ATTR_ACCESS_MODE
(default: SQL_MODE_READ_WRITE)
SQL_ATTR_AUTOCOMMIT
(default: SQL_AUTOCOMMIT_ON)
SQL_ATTR_CURRENT_CATALOG
(default: NONSTOP_SYSTEM_NSK)
An application, however, cannot change the schema using an
ODBC API function. If more than one user wants to create
objects in the same schema, set the schema to
PUBLIC_ACCESS_SCHEMA (the default) using the
Microsoft ODBC Data Source Administrator.
Note: The catalog must exist on the NonStop Kernel.