当前位置:网站首页>Kingbasees client programming interface guide ODBC (4. Create data source)
Kingbasees client programming interface guide ODBC (4. Create data source)
2022-07-28 23:48:00 【Thousands of sails passed by the side of the sunken boat_】
4. create data source
This chapter describes how to configure and create in different operating systems KingbaseES ODBC data source .
4.1. stay Windows Created in KingbaseES ODBC data source
choice 『 Start 』│『 Set up 』│『 Control panel 』 menu , Double click in the pop-up window 【 Management tools 】 Icon to enter the management tool interface , double-click 【 data source (ODBC)】 Icon .

choice 【 System DSN】 tab , single click 【 add to (D)…】 Button , The system pops up 【 Create a new data source 】 Dialog box .

stay ODBC In the driver program list , choice 【KingbaseES 8.6 ODBC Driver】, single click 【 complete 】 Button , The system pops up 【KingbaseES ODBC Data source configuration 】 Dialog box .

stay 【 Data source name 】 Users can fill in anything that is not related to the existing DSN Duplicate name . In the dialog box , Users must fill in 【 Database name 】.
about 【 Database name 】 and 【 user name 】, Whether you configure the connection in the data source configuration interface , Or call SQLDriverConnect() Methods the connection , There are the following rules :
If the user name 、 The database name is not enclosed in double quotation marks
When the server case_sensitive The attribute is "on" when , It means login with the user name in uppercase , The connected database name is in uppercase .
for example , enter one user name "SYSTEM" Database name "TEST", It is based on users "SYSTEM" Connect "TEST" database .
Corresponding SQLDriverConnect The connection string of method is :"DRIVER={KingbaseES 8.6 ODBC Driver};SERVER=127.0.0.1;UID=SYSTEM;PWD=MANAGER;DATABASE=TEST;PORT=54321".
When the server case_sensitive The attribute is "off" when , Then it means to log in with the user name with the same letter as the entered user name , Connect to a database with the same letters as the entered database name .
for example , enter one user name "system" Database name "test", And user name "System" Database name "Test" The connection is the same .
Corresponding SQLDriverConnect The example connection string of the method is :"DRIVER={KingbaseES 8.6 ODBC Driver};SERVER=127.0.0.1;UID=system;PWD=MANAGER;DATABASE=test;PORT=54321".
If the user name 、 The database name is enclosed in double quotation marks
When the server case_sensitive The attribute is "on" when , Then it means to log in with a user name with the same case as that in the double quotation marks , The connection is the database name with the same case in double quotation marks .
for example , enter one user name "system" Database name "test", It is based on users "system" Connect "test" database .
Corresponding SQLDriverConnect The example connection string of the method is :"DRIVER={KingbaseES 8.6 ODBC Driver};SERVER=127.0.0.1;UID="system";PWD=MANAGER;DATABASE="test";PORT=54321".
When the server case_sensitive The attribute is "off" when , Then it means to log in with the same user name as the letter contained in the double quotation marks , The connected database name is the same as the letter contained in double quotation marks .
for example , enter one user name "system" Database name "test", And user name "System" Database name "Test" The connection is the same .
Corresponding SQLDriverConnect The example connection string of the method is :"DRIVER={KingbaseES 8.6 ODBC Driver};SERVER=127.0.0.1;UID="system";PWD=MANAGER;DATABASE="test";PORT=54321".
If the user name 、 The database name contains double quotation marks
The user name or database name must be enclosed in double quotation marks , And you need to write the double quotation marks twice to indicate escape .
for example , enter one user name "sys""tem" And database name "te""st", It is based on users sys"tem Connect te"st database .
Corresponding SQLDriverConnect The example connection string of the method is :"DRIVER={KingbaseES 8.6 ODBC Driver};SERVER=127.0.0.1;UID="sys""tem";PWD=MANAGER;DATABASE="te""st";PORT=54321".
If advanced configuration is required , You can click 【 data source 】 Button , The system pops up 【 Advanced options 】 Dialog box .
Select or set the option value you need ( Please refer to KingbaseES ODBC The extended properties of Medium 6.1 chapter ), And then click 【 confirm 】 Button ,【 Advanced options 】 The dialog box closes , New ODBC The data source will adopt the settings in this dialog .
single click 【 preservation 】 Button , This creates a KingbaseES ODBC data source .
If you want to test whether the connection to the data source is successful , You can click 【 test 】, The system will pop up the corresponding message box according to the test results .
4.2. stay Linux Created in KingbaseES ODBC data source
To configure ODBC Data Source Need to use odbcinst.
Configure through the command line ODBC Data source steps :
First check ODBC Driver Has it been installed? .
Find... In the system odbcinst.ini file , and /usr/bin/odbcinst Corresponding odbcinst.ini stay /etc Under the table of contents , and /usr/local/bin/odbcinst Corresponding odbcinst.ini stay /usr/local/etc Under the table of contents . stay odbcinst.ini Find in the file [KingbaseES 8.6 ODBC Driver] This one . without , Then write a template file "template_file1" , It includes the following :
[KingbaseES 8.6 ODBC Driver] Description = KingbaseES 8.6 ODBC Driver for Linux Driver = /opt/Kingbase/ES/V8R6/Odbc/kdbodbcw.so Debug = 0 CommLog = 1
then , Execute the following command :
odbcinst -i -d -f template_file1
This installs KingbaseES Of ODBC Driver.
Write a template file template_file2, It includes the following :
[kingbase] Description = KingbaseES Driver = KingbaseES 8.6 ODBC Driver Trace = No TraceFile = Database = TEST Servername = localhost Username = SYSTEM Password = 123 Port = 54321 ReadOnly = No RowVersioning = No ShowSystemTables = No ShowOidColumn = No FakeOidIndex = No ConnSettings =
[kingbase] Appoint DSN be known as kingbase. To the left of the equal sign is the option name , On the right is the option value .
Driver,Servername,Port,Username,Password,Database etc. 6 Item is a required item . among , Note the case of user name and database name .
For details, please refer to stay Windows Created in KingbaseES ODBC data source Partial content .
"Driver = KingbaseES 8.6 ODBC Driver" Indicate the right to DSN Use KingbaseES Of ODBC Driver.
Please refer to KingbaseES ODBC The extended properties of Medium 6.2 chapter .
Execute the following command :
odbcinst -i -s -f template_file2
This creates a new system called kingbase Of KingbaseES ODBC data source .
If you want to test whether the connection to the data source is successful , have access to unixODBC Self contained isql Tools for testing , The method is as follows :
isql The usage of is :
isql DSN [UID [PWD]] [options],[options]For parameter settings, see :
isql -helpAs configured above ODBC Data sources for example , Execute the following command :
/* Show unixODBC The current version of */ [email protected]:~$ isql --v unixODBC 2.3.4 /* If the user name and password are filled in the data source , The user name and password can be omitted here , Shorthand for isql kingbase */ [email protected]:~$ isql kingbase SYSTEM MANAGER
If the connection is successful, the following information will be displayed :
+---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+
If the connection fails, the following message will be displayed :
[ISQL]ERROR: Could not SQLConnect
边栏推荐
- 2022 G2 power plant boiler stoker examination question bank simulated examination platform operation
- 金仓数据库 KingbaseES 与 Oracle 的兼容性说明(4. SQL)
- 剑指 Offer 41. 数据流中的中位数
- [self] - brush questions set
- 解决线程安全问题&&单例模式
- General addition, deletion, modification and query of custom MVC
- Learn browser decoding from XSS payload
- 【详细超简单】如何使用WebSocket链接
- Deep analysis of integrated learning xgboost
- Compatibility description between kingbasees and Oracle (3. Common functions)
猜你喜欢

类中多函数填写,LeetCode919——完全二叉树插入器

Achieve high throughput through Wi Fi 7 - insight into the next generation of Wi Fi physical layer

A new generation of ultra safe cellular battery, Sihao aipao, will be available from 139900 yuan

CV目标检测模型小抄(2)
![Trivy [3] custom scanning strategy](/img/a8/49daba73e5ac4c5dbb6e4d007e056b.png)
Trivy [3] custom scanning strategy

互动滑轨屏在展厅中应用的制作步骤

Asynchronism and synchronization of visa write and read functions by LabVIEW

Rhce第一天

Rhce第二天

Worthington丨Worthington胰蛋白酶化学性质及相关研究
随机推荐
添加构建依赖项报错
从XSS Payload学习浏览器解码
[self] - brush questions BFS
剑指 Offer 41. 数据流中的中位数
超参数优化(网格搜索和贝叶斯优化)
Xss.haozi.me range details
The computer doesn't know what to uninstall, can't open the calculator, can't edit screenshots, can't open txt files, and so on
浪潮ClusterEngineV4.0 远程命令执行漏洞 CVE-2020-21224
hutool官网(hutool好用吗)
2022 R2 mobile pressure vessel filling test question simulation test platform operation
多模态模型小抄(1)
顶级“黑客”能厉害到什么地步?无信号也能上网,专家:高端操作!
深度之眼(十八)——偏导数
Crud of MySQL
小程序editor富文本编辑使用及rich-text解析富文本
2022G3锅炉水处理考试模拟100题模拟考试平台操作
网络流量监控工具iftop
2022焊工(初级)上岗证题目及答案
金仓数据库 KingbaseES 与 Oracle 的兼容性说明(5. PL/SQL)
阻塞式队列


