科达圣龙s-k138支持的mp4格式是什么?

[复制链接]
查看11 | 回复0 | 2006-9-4 19:22:52 | 显示全部楼层 |阅读模式
Microsoft ODBC 3.0 引入了连接池概念。连接池使 ODBC 应用程序能够重用现有来自池, 这样不 ODBC 应用程序无需重新定位连接 通过为任何后续连接完成连接进程。 当 ODBC 应用程序断开连接, 保存该连接 到池中代替实际断开。 保持此连接时间 池中取决于 ODBC 驱动程序的 CPTimeout 属性。 当 超时到期, 该连接被关闭并从池中删除。 ODBC应用程序可用来更改此值 CPTimeout, 和 SQLConfigDriver 值适用于使用指定 ODBC 驱动程序的所有 ODBC 应用程序。 对于 CPTimeout 默认值为 60 秒。 连接池是很有用当 ODBC 应用程序如 Microsoft Internet 服务器信息 (例如) 连接和断开频繁。 Microsoft Internet Information Server (IIS) 3.0 Active Server Pages (ASP) 利用了连接池。 您可启用连接池对 IIS 用户通过更改是 StartConnectionPool 值为 1。 StartConnectionPool 位于下: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\ASP\Parameters ODBC 应用程序可以使用 SQLSetEnvAttr 来启用连接池。 下面是如何启用连接池 ODBC 应用程序中的示例:
#include
#include
#include
#include
void main() { SQLHENV henv; SQLHDBC hdbc; int
i=0; if (!SQL_SUCCEEDED(SQLSetEnvAttr(
NULL,// make process level cursor pooling
SQL_ATTR_CONNECTION_POOLING,
(SQLPOINTER)SQL_CP_ONE_PER_DRIVER,
SQL_IS_INTEGER))) printf("SQLSetEnvAttr/SQL_ATTR_CONNECTION_POOLING error\n"); if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_ENV, NULL, &henv)))
printf("SQLAllocHandle error\n"); // set the ODBC behavior version. if (!SQL_SUCCEEDED(SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC2, SQL_IS_INTEGER)))
printf("SQLSetEnvAttr/SQL_ATTR_ODBC_VERSION error\n"); //set the matching condition for using an existing connection in the pool if (!SQL_SUCCEEDED(SQLSetEnvAttr(henv, SQL_ATTR_CP_MATCH, (SQLPOINTER) SQL_CP_RELAXED_MATCH, SQL_IS_INTEGER))) printf("SQLSetEnvAttr/SQL_ATTR_CP_MATCH error\n");while (i < 10) { if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_DBC,
henv, &hdbc)))
printf("SQLAllocHandle error\n");
if (!SQL_SUCCEEDED(SQLConnect(hdbc, (unsigned char*)"testing\0", SQL_NTS,
(unsigned char*)"sa\0", SQL_NTS, (unsigned char*)"\0", SQL_NTS)))
printf("SQLConnect error\n"); else
printf("Connect successfully %d times\n", i); //the first time, the application calls SQLDisconenct, it will return
//the connection to the //pool SQLDisconnect(hdbc); if (!SQL_SUCCEEDED(SQLFreeHandle(SQL_HANDLE_DBC, hdbc)))
printf("SQLFreeHandle error\n"); i++; } SQLFreeHandle(SQL_HANDLE_ENV, henv); }
当 ODBC 应用程序调用 SQLDisconnect 初次, 该连接保存到池。 任何后续 SQLConnect / SQLDisconnect 匹配必需条件将重用第一个连接。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行