当前位置:网站首页>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
边栏推荐
- How to open a profitable gym? I tell you from one year's experience that don't fall in love
- 使用这个,你发的消息就无法被监控了
- 超参数优化(网格搜索和贝叶斯优化)
- sql 左连接,内连接 的写法「建议收藏」
- AUTOCAD——Excel表格导入CAD、CAD合并两兄弟
- Trivy [3] custom scanning strategy
- Arm-A53资料「建议收藏」
- 深度剖析集成学习GBDT
- C语言 n*n矩阵求值及求逆矩阵[通俗易懂]
- 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
猜你喜欢

2022 R2 mobile pressure vessel filling test question simulation test platform operation

CV实例分割模型小抄(1)

AUTOCAD——Excel表格导入CAD、CAD合并两兄弟

Fundamental inquiry binary tree

Manufacturing steps of interactive slide screen in exhibition hall

【自】-刷题-动态规划

Optimization and implementation of custom MVC

2022 simulated examination platform operation of hoisting machinery command examination questions

Read the recent trends of okaleido tiger and tap the value and potential behind it

网络流量监控工具iftop
随机推荐
金仓数据库KingbaseES 客户端编程接口指南 - ODBC (2. 概述)
控件 圆角描边 MaterialShapeDrawable
Design idea of room inventory in hotel reservation system database
使用Pytorch快速训练网络模型
[self] - brush questions set
What's special about this wireless router, which is popular in the whole network?
小程序editor富文本编辑使用及rich-text解析富文本
Rhce第一天
二舅火了,全网刷屏,他凭什么能治好我的精神内耗?
[self] - brush questions logic
金仓数据库 KingbaseES与Oracle的兼容性说明(2. 数据类型)
Codeforces Round #474 (Div. 1 + Div. 2) - C, F
MySQL transaction and storage system
22 Niu Ke multi school Day1 J - serval and essay heuristic merging
Combination of smart TV and applet
利用递归和链表头插法实现链表成组的翻转——LeetCode25 K个一组翻转链表
Zabbix 5.0 使用自带Redis模版监控
[self] - question brushing - dynamic programming
【自】-刷题-数组
【自】-刷题-逻辑


