当前位置:网站首页>Jincang database kingbasees client programming interface guide ODBC (5. Development process)
Jincang database kingbasees client programming interface guide ODBC (5. Development process)
2022-07-28 23:48:00 【Thousands of sails passed by the side of the sunken boat_】
5. The development process
In the correct setting KingbaseES ODBC After the data source , Application usage KingbaseES ODBC API The steps are as follows :
call SQLAllocHandle Function allocation environment handle .
call SQLAllocHandle Function to allocate connection handle .
Use the allocated connection handle to call SQLConnect,SQLBrowseConnect perhaps SQLDriverConnect connect to a data source . It specifies the name of the data source and any additional information needed to complete the connection .
Process one or more SQL sentence :
The application will SQL Put the text string in the buffer .
If the statement includes parameter markers , Then set it to the parameter value .
If the statement returns a result set , The application program assigns the tag name to the statement or uses the default tag name of the driver . The application is “SQLPrepare or SQLExecute” Submit statement .
If the statement creates a result set , The application asks for the result set attribute , For example, the number of columns , And the name of a specific column 、 Type, etc . It allocates storage for each column in the result set and retrieves the results .
If the statement causes an error , The application program extracts the error information from the driver and takes corresponding actions .
End each transaction by committing or re operating .
When the interaction between the application and the data source ends , Terminate connection , Release the corresponding handle . The sequence of function execution is as follows :
SQLAllocHandle(SQL_HANDLE_ENV,NULL,&henv)<=> SQLAllocEnv ;
SQLAllocHandle(SQL_HANDLE_DBC,henv,&hdbc)<=> SQLAllocConnect ;
SQLConnect ;
SQLAllocHandle(SQL_HANDLE_STMT,hdbc,&hstmt)<=> SQLAllocStmt ;
Handle SQL sentence (SQLPrepare This step can be omitted, but it must be called SQLExecDirect);
If there are binding parameters, the binding assignment (SQLBindParameter);
Can pass SQLGetDescField, SQLColAttribute, SQLDescribeCol Wait for functions to get information ( It can be omitted );
adopt SQLExecute or SQLExecDirect Execute function ;
To get the results (SQLFetch, SQLBindCol, SQLGetData...);
SQLFreeHandle(SQL_HANDLE_STMT,hstmt)<=> SQLFreeStmt ;
SQLDisconnect ;
SQLFreeHandle(SQL_HANDLE_DBC,hdbc)<=> SQLFreeConnect ;
SQLFreeHandle(SQL_HANDLE_ENV,henv)<=> SQLFreeEnv ;
In order for users to better use KingbaseES ODBC Function access KingbaseES database , This document also gives some ODBC Operation example of , Please see the example .
边栏推荐
- In depth analysis of integrated learning xgboost (Continued)
- Class, leetcode919 -- complete binary tree inserter
- 2022 G2 power plant boiler stoker examination question bank simulated examination platform operation
- 2022焊工(初级)上岗证题目及答案
- 【自】-刷题-逻辑
- 金仓数据库 KingbaseES 与 Oracle 的兼容性说明(3. 常用函数)
- Arduino uno driver universe 1.8 'TFT SPI screen example demonstration (including data package)
- 顶级“黑客”能厉害到什么地步?无信号也能上网,专家:高端操作!
- 台式机dp接口在哪(主机没有dp接口怎么办)
- Read the recent trends of okaleido tiger and tap the value and potential behind it
猜你喜欢
2022 welder (Junior) work license questions and answers
【自】-刷题-集合
General addition, deletion, modification and query of custom MVC
2022t elevator repair examination questions and simulation examination
[self] - question brushing - dynamic programming
Exchange 2013 SSL证书安装文档
Custom MVC principle and framework
A new generation of ultra safe cellular battery, Sihao aipao, will be available from 139900 yuan
苹果官网正在更新维护 Apple Store,国行 iPhone 13 / Pro 等产品将最高优惠 600 元
酪氨酸脱羧酶丨Worthington粪链球菌酪氨酸脱羧酶的特征
随机推荐
[self] - brush questions logic
Codeforces Round #474 (Div. 1 + Div. 2) - C, F
深度剖析集成学习GBDT
Ape anthropology topic 20
field injection is not recommended 的解决办法
台式机dp接口在哪(主机没有dp接口怎么办)
2022焊工(初级)上岗证题目及答案
添加构建依赖项报错
Crud of MySQL
Read the recent trends of okaleido tiger and tap the value and potential behind it
Go 中的并发 Concurrency
宝塔 phpmyadmin未授权访问漏洞
Byte 8 years' experience of female test Director - for girls who want to change careers or are about to enter the testing industry
leetcode 763. Partition Labels 划分字母区间(中等)
[self] - brush questions array
Neglected smart TV applet field
【自】-刷题-动态规划
【自】-刷题-逻辑
深度剖析集成学习Adaboost
金仓数据库 KingbaseES与Oracle的兼容性说明(2. 数据类型)