sync ODBC user guide changes from ODBC repo.
Signed-off-by: chenpingzeng <chenpingzeng@huawei.com>
This commit is contained in:
parent
32f0810be0
commit
df7486dade
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# openLooKeng ODBC User Manual
|
||||
|
||||
## Overview
|
||||
|
|
@ -9,7 +8,7 @@ This user manual contains information about the openLooKeng ODBC driver for Wind
|
|||
|
||||
Open Database Connectivity (ODBC) is an interoperable interface protocol proposed by Microsoft for applications to access different DBMSs. It defines a universal database access mechanism and provides a set of ODBC APIs for accessing databases to simplify the interoperability between clients and different DBMSs.
|
||||
|
||||
The ODBC driver enables applications to connect to databases. This product is the ODBC driver for openLooKeng and complies with the core level consistency specifications of ODBC 3.x.
|
||||
The ODBC driver enables applications to connect to databases. This product is the ODBC driver for openLooKeng and complies with the core level consistency specifications of ODBC 3.5.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
|
|
@ -25,6 +24,8 @@ The ODBC driver enables applications to connect to databases. This product is th
|
|||
|
||||
- Windows 10 64-bit
|
||||
|
||||
- Windows Server 2016 64-bit
|
||||
|
||||
> This product has not been strictly tested for other Windows versions. You can try them by yourself. This product does not provide any quality assurance.
|
||||
|
||||
## Installing the openLooKeng ODBC Driver
|
||||
|
|
@ -33,15 +34,18 @@ This document describes installing from binary distribution for ODBC driver, whi
|
|||
|
||||
### System Requirements
|
||||
|
||||
* This driver provides only the 64-bit installation package. Ensure that the OS is Windows 10 64-bit.
|
||||
The machine that the ODBC driver is installed must meet the following requirements:
|
||||
|
||||
* Ensure that the installation disk has more than 100 MB available space.
|
||||
* One of the following operating systems:
|
||||
* Windows 10 (64 bit)
|
||||
* Windows Server 2016 (64 bit)
|
||||
* 180 MB of available disk space.
|
||||
|
||||
### Procedure
|
||||
|
||||
Before installing the driver, ensure that you have the administrator rights.
|
||||
|
||||
1. Double-click the **hetu-odbc-win64.msi** installation package. The welcome page is displayed. Click **Next**.
|
||||
1. Double-click the msi installation package. The welcome page is displayed. Click **Next**.
|
||||
2. The second page is the user agreement. accept the terms and click **Next**.
|
||||
3. On the third page, select an installation mode. You are advised to select **Complete**.
|
||||
4. On the fourth page, select an installation path and click **Next**.
|
||||
|
|
@ -62,7 +66,7 @@ Before an application uses the openLooKeng ODBC driver, the data source DSN must
|
|||
2. In **Control Panel**, click **System and Security**, and then click **Administrative Tools**.
|
||||
|
||||
3. In **Administrative Tools**, click **ODBC Data Sources (64-bit)**.
|
||||
|
||||
|
||||
> Note: You can also type **ODBC** in the search box of the Windows 10 **Start** menu and click **ODBC Data Sources (64-bit)** to open it.
|
||||
|
||||
### Adding the User DSN
|
||||
|
|
@ -74,7 +78,7 @@ Before an application uses the openLooKeng ODBC driver, the data source DSN must
|
|||
3. The openLooKeng ODBC Driver configuration page is displayed. On the welcome page, enter the name of the DSN to be created in the **Name** text box, enter the additional description of the DSN in the **Description** text box, and click **Next**.
|
||||
|
||||
4. The second page contains the following six text boxes. The functions and usage are as follows:
|
||||
|
||||
|
||||
| Text Box| Description|
|
||||
|----------|----------|
|
||||
| Connect URL| IP address and port number of the openLooKeng server to be connected.|
|
||||
|
|
@ -86,7 +90,7 @@ Before an application uses the openLooKeng ODBC driver, the data source DSN must
|
|||
|
||||
Set the parameters on the second page, and then click **Test DSN**. After the system displays a message indicating that the operation is successful, click **Next**.
|
||||
|
||||
5. In the **Statement(s)** text box on page 3, enter the initial statement sent after the connection to the openLooKeng server is established. After **Debug** is selected, the driver creates a debugging log file named **MAODBC.LOG** in **C:\\Users\\***current user***\\AppData\\Local\\Temp** to record openLooKeng ODBC driver debugging information. Click **Finish**.
|
||||
5. In the **Statement(s)** text box on page 3, enter the initial statement sent after the connection to the openLooKeng server is established. After **Debug** is selected, the driver creates a debugging log file named **MAODBC.LOG** in **%TMP%** to record openLooKeng ODBC driver debugging information. After you click **Test DSN** on page 2, user can configure the connection character set from the **Character Set** drop-down box. Select **Enable automatic reconnect**, when the system is sending messages, it automatically reconnects with the server upon a connection failure. (The automatic reconnection function does not ensure transaction consistency. Exercise caution when enabling this function). Click **Finish**.
|
||||
|
||||
### Configuring the ODBC Connection for the DSN
|
||||
|
||||
|
|
@ -119,7 +123,7 @@ SSLTrustStorePath=F:/openLooKeng/hetuserver.jks
|
|||
# Java TrustStore password
|
||||
#SSLTrustStorePassword
|
||||
|
||||
# Kerberos service name, fixed at "HTTP"
|
||||
# Kerberos service name, fixed at "HTTP"
|
||||
KerberosRemoteServiceName=HTTP
|
||||
|
||||
# Kerberos principal
|
||||
|
|
@ -156,5 +160,17 @@ The following table lists the data types supported by the driver, ODBC data type
|
|||
| `TIMESTAMP`| `SQL_TYPE_TIMESTAMP`|
|
||||
| `INTERVAL YEAR TO MONTH`| `SQL_VARCHAR`|
|
||||
| `INTERVAL DAY TO SECOND`| `SQL_VARCHAR`|
|
||||
| `ARRAY` | `SQL_VARCHAR` |
|
||||
| `MAP` | `SQL_VARCHAR` |
|
||||
| `ROW` | `SQL_VARCHAR` |
|
||||
| `JSON` | `SQL_VARCHAR` |
|
||||
|
||||
You can obtain the details about data types by calling **SQLGetTypInfo** in **Catalog Functions**.
|
||||
You can obtain the details about data types by calling **SQLGetTypInfo** in **Catalog Functions**.
|
||||
|
||||
## Character Set
|
||||
|
||||
The openLooKeng ODBC driver supports **both ANSI and Unicode** applications. The default connection character set is the system default character set for ANSI applications and utf8 for Unicode applications. If the character set used by the application is different from the above-mentioned character set, it may cause garbled characters. For this, the user should specify the connection character set to adapt to the character set required by the application. The corresponding configuration of the connection character set is described as follows.
|
||||
|
||||
When calling the ODBC API to retrieve data, if bound to the SQL_C_WCHAR C data type buffer, the driver will return the Unicode encoded result for both ANSI and Unicode applications. When bound to the SQL_C_CHAR C data type buffer, by deafult, the driver will return to the ANSI application the result encoded in system default character set, and for Unicode application the driver will return the result encoded in utf8. If the encoding character set used by the application does not match the default, the result may be garbled. To this end, the user should configure the connection character set to specify the encoding of the result. For example, if the application has garbled Chinese characters, you can try to configure the connection character set to GBK or GB2312.
|
||||
|
||||
While configuring data source all connection character sets supported by the openLooKeng ODBC driver can be set in the **Character Set** drop-down box on the page 3 of the User interface. User can select the connection character from the drop-down box after the **Test DSN** is success.
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# openLooKeng ODBC用户手册
|
||||
|
||||
## 总览
|
||||
|
|
@ -9,13 +8,13 @@
|
|||
|
||||
ODBC(Open Database Connectivity 开放数据连接)是微软提出的一个能让应用访问不同DBMS的互操作接口协议,其定义了一个通用的数据库访问机制并提供了一组访问数据库的应用程序编程接口(ODBC API)以简化客户端和不同DBMS间的互操作。
|
||||
|
||||
ODBC驱动为应用提供了连接到数据库的能力,本产品为openLooKeng的ODBC驱动程序,符合ODBC 3.x的核心级(Core Level)一致性规范。
|
||||
ODBC驱动为应用提供了连接到数据库的能力,本产品为openLooKeng的ODBC驱动程序,符合ODBC 3.5的核心级(Core Level)一致性规范。
|
||||
|
||||
### 先决条件
|
||||
|
||||
**使用本产品需要具备以下知识:**
|
||||
|
||||
* ANSI结构化查询语言(SQL)
|
||||
* ANSI结构化查询语言(SQL)
|
||||
|
||||
* [ODBC程序员参考文档](https://docs.microsoft.com/en-us/sql/odbc/reference/odbc-programmer-s-reference?view=sql-server-ver15)
|
||||
|
||||
|
|
@ -25,6 +24,8 @@ ODBC驱动为应用提供了连接到数据库的能力,本产品为openLooKen
|
|||
|
||||
- Winodows 10 64bit
|
||||
|
||||
- Winodows Server 2016 64bit
|
||||
|
||||
> 其他版本的Windows系统未经过严格测试,用户可以自己尝试,本产品不做任何质量保证
|
||||
|
||||
|
||||
|
|
@ -35,15 +36,19 @@ ODBC驱动为应用提供了连接到数据库的能力,本产品为openLooKen
|
|||
|
||||
### 配置需求
|
||||
|
||||
* 本驱动只提供64位安装包,请确保系统为Windows 10 64bit
|
||||
安装本驱动的系统,需要满足如下要求:
|
||||
|
||||
* 请确保安装磁盘具有超过100MB的可用磁盘空间
|
||||
* 请确保系统为如下系统:
|
||||
* Windows 10 (64 bit)
|
||||
* Windows Server 2016 (64 bit)
|
||||
|
||||
* 请确保安装磁盘具有超过180MB的可用磁盘空间
|
||||
|
||||
### 安装步骤
|
||||
|
||||
安装本驱动前请确认当前具有管理员权限。
|
||||
|
||||
1. 双击hetu-odbc-win64 .msi安装包,出现安装的欢迎界面,单击“Next”。
|
||||
1. 双击msi安装包,出现安装的欢迎界面,单击“Next”。
|
||||
2. 第二页为用户协议,勾选接受后单击“Next”。
|
||||
3. 第三页选择安装方式,建议选择“Complete”完整安装。
|
||||
4. 第四页选择安装路径,配置后单击“Next”。
|
||||
|
|
@ -90,7 +95,7 @@ ODBC驱动为应用提供了连接到数据库的能力,本产品为openLooKen
|
|||
|
||||
完成第2页各输入框的填写并单击“Test DSN”按钮显示成功信息后,单击“Next”按钮
|
||||
|
||||
5. 第3页Statement(s)输入框中可以输入在建立到openLooKeng服务器的连接后发送的初始语句,勾选“Debug”后驱动会在“C:\Users\\*当前用户*\AppData\Local\Temp”路径下创建名为“MAODBC.LOG”的调试日志文件,记录openLooKeng ODBC Driver的调试信息。最后在本页单击“Finishi”按钮完成DSN的配置与添加。
|
||||
5. 第3页Statement(s)输入框中可以输入在建立到openLooKeng服务器的连接后发送的初始语句,勾选“Debug”后驱动会在%TMP%路径下创建名为“MAODBC.LOG”的调试日志文件,记录openLooKeng ODBC Driver的调试信息,在第二页单击“Test DSN”成功后可以从“Character Set”下拉框中选择需要配置的连接字符集。勾选“Enable automatic reconnect”,在发送消息时如果连接已失效,将会自动与server重建连接(本功能无法对事务一致性提供保障,使用须谨慎)。最后在本页单击“Finish”按钮完成DSN的配置与添加。
|
||||
|
||||
### DSN配置ODBC连接
|
||||
|
||||
|
|
@ -123,13 +128,13 @@ SSLTrustStorePath=F:/openLooKeng/hetuserver.jks
|
|||
# Java TrustStore密码
|
||||
#SSLTrustStorePassword
|
||||
|
||||
# Kerberos服务名称,固定为HTTP
|
||||
# Kerberos服务名称,固定为HTTP
|
||||
KerberosRemoteServiceName=HTTP
|
||||
|
||||
# Kerberos principal
|
||||
KerberosPrincipal=test
|
||||
|
||||
# 访问数据源用户的krb5配置文件
|
||||
# 访问数据源用户的krb5配置文件
|
||||
KerberosConfigPath=F:/openLooKeng/krb5.conf
|
||||
|
||||
# 访问数据源用户的keytab配置文件
|
||||
|
|
@ -142,26 +147,37 @@ KerberosKeytabPath=F:/openLooKeng/user.keytab
|
|||
|
||||
## 驱动支持的数据类型
|
||||
|
||||
本驱动支持的数据类型与对应的ODBC数据类型及openLooKeng数据类型如下:
|
||||
本驱动支持的数据类型与对应的ODBC数据类型如下:
|
||||
|
||||
| openLooKeng数据类型 | ODBC数据类型 |
|
||||
| :----------------------: | :------------------: |
|
||||
| `BOOLEAN` | `SQL_BIT` |
|
||||
| `TINYINT` | `SQL_TINYINT` |
|
||||
| `SMALLINT` | `SQL_SMALLINT` |
|
||||
| `INTEGER` | `SQL_INTEGER` |
|
||||
| `BIGINT` | `SQL_BIGINT` |
|
||||
| `REAL` | `SQL_REAL` |
|
||||
| `DOUBLE` | `SQL_DOUBLE` |
|
||||
| `DECIMAL` | `SQL_DECIMAL` |
|
||||
| `CHAR` | `SQL_CHAR` |
|
||||
| `VARCHAR` | `SQL_VARCHAR` |
|
||||
| `VARBINARY` | `SQL_VARBINARY` |
|
||||
| `DATE` | `SQL_TYPE_DATE` |
|
||||
| `TIME` | `SQL_TYPE_TIME` |
|
||||
| `TIMESTAMP` | `SQL_TYPE_TIMESTAMP` |
|
||||
| `INTERVAL YEAR TO MONTH` | `SQL_VARCHAR` |
|
||||
| `INTERVAL DAY TO SECOND` | `SQL_VARCHAR` |
|
||||
| openLooKeng数据类型 | ODBC数据类型 |
|
||||
| :------------------: | :----------------------: |
|
||||
| `BOOLEAN` | `SQL_BIT` |
|
||||
| `TINYINT` | `SQL_TINYINT` |
|
||||
| `SMALLINT` | `SQL_SMALLINT` |
|
||||
| `INTEGER` | `SQL_INTEGER` |
|
||||
| `BIGINT` | `SQL_BIGINT` |
|
||||
| `REAL` | `SQL_REAL` |
|
||||
| `DOUBLE` | `SQL_DOUBLE` |
|
||||
| `DECIMAL` | `SQL_DECIMAL` |
|
||||
| `CHAR` | `SQL_CHAR` |
|
||||
| `VARCHAR` | `SQL_VARCHAR` |
|
||||
| `VARBINARY` | `SQL_VARBINARY` |
|
||||
| `DATE` | `SQL_TYPE_DATE` |
|
||||
| `TIME` | `SQL_TYPE_TIME` |
|
||||
| `TIMESTAMP` | `SQL_TYPE_TIMESTAMP` |
|
||||
|`INTERVAL YEAR TO MONTH`| `SQL_VARCHAR` |
|
||||
|`INTERVAL DAY TO SECOND`| `SQL_VARCHAR` |
|
||||
|`ARRAY`| `SQL_VARCHAR` |
|
||||
|`MAP`| `SQL_VARCHAR` |
|
||||
|`ROW`| `SQL_VARCHAR` |
|
||||
|`JSON`| `SQL_VARCHAR` |
|
||||
|
||||
数据类型的详细信息用户可以通过调用Catalog Functions中的SQLGetTypInfo获得
|
||||
|
||||
## 字符集
|
||||
|
||||
本驱动同时支持ANSI与Unicode应用,默认的连接字符集对于ANSI应用为系统默认字符集,对于Unicode应用为utf8编码。如果应用使用的字符集与上述默认字符集不同可能会出现乱码,对此用户应该指定连接字符集使之与应用所需的字符集相适应。下面对连接字符集的相应配置进行说明。
|
||||
|
||||
在调用ODBC API获取数据时,若绑定到SQL_C_WCHAR类型的缓冲区,无论对ANSI还是Unicode应用驱动都会返回Unicode编码的结果,而绑定到SQL_C_CHAR类型的缓冲区时在默认情况下驱动会对ANSI应用返回按系统默认字符集编码的结果,对Unicode应用会返回按utf8编码的结果。若应用采用的编码与默认不符,可能会造成结果乱码,为此用户应通过配置连接字符集以指定结果的编码。例如若应用出现中文乱码的情况,可以尝试将连接字符集配置为GBK或者GB2312。
|
||||
|
||||
当前本驱动所支持的所有连接字符集都可以在配置数据源的UI界面第三页中的“Character Set”下拉框中进行设置,用户可以在“Test DSN”成功后跟据自身需求从下拉框中选择连接字符集。
|
||||
Loading…
Reference in New Issue