通过API获取参数MAX_CONNECTIONS [英] Obtaining parameter MAX_CONNECTIONS through the API
问题描述
我正在尝试使用API获取参数MAX_CONNECTIONS。
以下是我使用的代码段:< br $> b $ b struct sqlfupd paramItem [5];
paramItem [0] .token = SQLF_DBTN_MAX_CONNECTIONS;
paramItem [0] .ptrvalue = (char *)malloc(sizeof(int));
sqlfddb(dbName,1,paramItem,& db2ConnArea);
printf(" ----- ------------ STAT ===============%d \ n",*(int
*)paramItem [ 0] .ptrvalue);
当我编译它时,我收到以下错误:
`SQLF_DBTN_MAX_CONNECTIONS''未声明(首次使用于这个函数)
当我试图获得以下参数时,按照
//webdocs.caspur.it/ibm/udb-6.1/db2hs/c/d_dbcofc.htm\"target =_ blank> http://webdocs.caspur.it/ibm/udb-6.1...c/d_dbcofc。 htm ,我
能够这样做:
SQLF_DBTN_LOCKLIST,SQLF_DBT N_BUFF_PAGE,SQLF_DBTN_MAXFILOP,
SQLF_DBTN_SOFTMAX,SQLF_DBTN_LOGPATH。
我的尝试出了什么问题?
谢谢
Hi,
I''m trying to acquire the parameter MAX_CONNECTIONS by using the API.
The following is the code segment I used:
struct sqlfupd paramItem[5];
paramItem[0].token = SQLF_DBTN_MAX_CONNECTIONS;
paramItem[0].ptrvalue = (char *)malloc(sizeof(int));
sqlfddb(dbName, 1, paramItem, &db2ConnArea);
printf("----------------- STAT =============== %d \n", *(int
*)paramItem[0].ptrvalue);
When I compiled that, I got the following error:
`SQLF_DBTN_MAX_CONNECTIONS'' undeclared (first use in this function)
When I tried to obtain the following parameters, as per the example
found on http://webdocs.caspur.it/ibm/udb-6.1...c/d_dbcofc.htm, I
was able to do so:
SQLF_DBTN_LOCKLIST, SQLF_DBTN_BUFF_PAGE, SQLF_DBTN_MAXFILOP,
SQLF_DBTN_SOFTMAX, SQLF_DBTN_LOGPATH.
What was wrong in my attempt?
Thanks
推荐答案
这真的很奇怪。
您检查过sqlutil.h文件吗?这个文件中是否存在SQLF_DBTN_MAX_CONNECTIONS
?
BTW:它可能无法解决您的问题,但您可以避免编译
$ b通过使用相应的常数值802来代替$ b。请
参考
http://publib.boulder.ibm.com/infoce...d/r0008190.htm
问候,
tuarek
Hi,
It is really weird.
Have you checked the sqlutil.h file? Does "SQLF_DBTN_MAX_CONNECTIONS"
exist in this file?
BTW: It may not solve your problem but you can avoid the compilation
error by using the corresponding constant value 802 instead. Please
refer to
http://publib.boulder.ibm.com/infoce...d/r0008190.htm
regards,
tuarek
Hi tuarek,
感谢您的回复。我正在看sqlutil.h,我在以下条目中找到了
:
#define SQLF_KTN_DF_ENCRYPT_LIST 801
#define SQLF_KTN_MAX_CONNECTIONS 802
我试过谷歌搜索SQLF_KTN_MAX_CONNECTIONS但它没有给我任何
的结果。
我尝试过按照你的建议给它802,但它返回0,这是
不正确。
任何想法?
谢谢
Hi tuarek,
Thanks for the reply. I was looking at sqlutil.h and I found the
following entries:
#define SQLF_KTN_DF_ENCRYPT_LIST 801
#define SQLF_KTN_MAX_CONNECTIONS 802
I tried googling for SQLF_KTN_MAX_CONNECTIONS but it didn''t give me any
results.
I tried giving it 802 as you''ve suggested but it returned 0, which was
not correct.
Any idea?
Thanks
P写道:
P wrote:
我''我试图通过使用API获取参数MAX_CONNECTIONS。
以下是我使用的代码段:
struct sqlfupd paramItem [5];
paramItem [0] .token = SQLF_DBTN_MAX_CONNECTIONS;
paramItem [0] .ptrvalue =(char *)malloc(sizeof(int));
你应该在这里检查内存分配是否成功。否则,
您的程序可能会因为段错而崩溃。
sqlfddb(dbName,1,paramItem,& db2ConnArea);
你应该使用db2CfgGet自版本8以来提供的API:
http://publib.boulder.ibm.com/infoce...n/r0008855.htm
printf( ----------------- STAT ===============%d \ n,*(int
* )paramItem [0] .ptrvalue);
当我编译它时,我收到以下错误:
`SQLF_DBTN_MAX_CONNECTIONS''未声明(首次在此函数中使用)
当我尝试获取以下参数时,根据 /db2hs/c/d_dbcofc.htmtarget =_ blank> http://webdocs.caspur.it/ibm/udb-6.1...c/d_dbcofc.htm ,我已经能够了这样做:
SQLF_DBTN_LOCKLIST,SQLF_DBTN_BUFF_PAGE,SQLF_DBTN_MAXFILOP,
SQLF_DBTN_SOFTMAX,SQLF_DBTN_LOGPATH。
我的尝试出了什么问题?
Hi,
I''m trying to acquire the parameter MAX_CONNECTIONS by using the API.
The following is the code segment I used:
struct sqlfupd paramItem[5];
paramItem[0].token = SQLF_DBTN_MAX_CONNECTIONS;
paramItem[0].ptrvalue = (char *)malloc(sizeof(int));
You should check here that the memory allocation was successful. Otherwise,
your program could just crash here with a segfault.
sqlfddb(dbName, 1, paramItem, &db2ConnArea);
You should use the "db2CfgGet" API that is provided since version 8:
http://publib.boulder.ibm.com/infoce...n/r0008855.htm
printf("----------------- STAT =============== %d \n", *(int
*)paramItem[0].ptrvalue);
When I compiled that, I got the following error:
`SQLF_DBTN_MAX_CONNECTIONS'' undeclared (first use in this function)
When I tried to obtain the following parameters, as per the example
found on http://webdocs.caspur.it/ibm/udb-6.1...c/d_dbcofc.htm, I
was able to do so:
SQLF_DBTN_LOCKLIST, SQLF_DBTN_BUFF_PAGE, SQLF_DBTN_MAXFILOP,
SQLF_DBTN_SOFTMAX, SQLF_DBTN_LOGPATH.
What was wrong in my attempt?
您必须包含sqlu til.h"并使用常量
SQLF_KTN_MAX_CONNECTIONS。顺便说一句,我不建议您在源代码中加上
显式802。更好地解决实际问题。
-
Knut Stolze
DB2信息集成开发
IBM德国
You have to include "sqlutil.h" and use the constant
SQLF_KTN_MAX_CONNECTIONS. Btw, I would not recommend that you put the
explicit 802 in your source code. Better fix the real problem.
--
Knut Stolze
DB2 Information Integration Development
IBM Germany
这篇关于通过API获取参数MAX_CONNECTIONS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!