Note: For details about the protocol implementation, see the end-to-end test cases in the test directory.
Note: Other Windows systems may also run properly, but we have not verified the system. You are welcome to provide the test results and problems of other systems. If you have any feedback, submit the issue.
The openLooKeng ODBC Driver solution reuses existing components to the maximum extent and uses the bridging solution (the front end uses the ODBC protocol and the back end uses the JDBC protocol for interconnection). The open-source software MariaDB ODBC driver and MyCat Server are selected, the openLooKeng ODBC Driver is implemented based on the two software.
Major modifications at the front end:
Major changes at the backend:
OpenLooKeng leverages the well-known open-source SQL engine - Presto, and add a lot of enhancements over Presto. Therefore, the openLooKeng ODBC driver is also considered for the Presto ecosystem. We are compatible with the Presto ecosystem based on the following points:
The connection and authentication functions with the server are offloaded to the JDBC driver layer. In the branch version of the Presto ecosystem, a large number of customized implementation solutions are provided to implement the functions. Each version uses its own JDBC driver to implement the interconnection of these functions. In terms of JDBC configuration parameters, we have streamlined the configuration parameters between the version and the DSN, the DSN allows you to flexibly configure JDBC parameters. For details, see JDBC Driver Adaptation.
The following software has been installed:
git clone https://gitee.com/openlookeng/hetu-odbc-driver.git
or
git clone https://github.com/openlookeng/hetu-odbc-driver
Go to the code directory and configure and compile the code.
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DCONC_WITH_MSI=OFF -DWITH_SSL=SCHANNEL.
cmake --build . --config RelWithDebInfo
Note: 1. During the build, two pieces of code that depend on the code repository are downloaded. Ensure that the download channel is available. For details about the two pieces of code, see the .gitmodules file.
2. If the build version needs to be specified, you can pass in the following four variables through the -D parameter:
MARIADB_ODBC_VERSION_MAJOR, MARIADB_ODBC_VERSION_MINOR, MARIADB_ODBC_VERSION_PATCH and GATEWAY_TAG. The first three Variables MAJOR, MINOR, and PATCH represent the three digits of the version number, and GATEWAY_TAG represents the release tag of the gateway code.
For example, to build version 1.0.1:
cmake -G "Visual Studio 16 2019" -A x64 -DMARIADB_ODBC_VERSION_MAJOR=1 -DMARIADB_ODBC_VERSION_MINOR=0 -DMARIADB_ODBC_VERSION_PATCH=1 -DGATEWAY_TAG="1.0.1" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DCONC_WITH_MSI=OFF -DWITH_SSL=SCHANNEL .
cmake --build . --config RelWithDebInfo
3. For the -G parameter, if you use Visual Studio 2017, set to "Visual Studio 15 2017".For more options, see the CMake manual.
NA
<Installation directory>\odbc_gateway\mycat\mycat.bat {start | stop | restart | status}
For details, see https://docs.microsoft.com/zh-cn/sql/odbc/admin/setting-tracing-options?view=sql-server-ver15 or https://docs.microsoft.com/EN-US/sql/odbc/admin/setting-tracing-options?view=sql-server-ver15
On the DSN configuration page, select DEBUG. The Driver records debug logs in the %TMP%\MAODBC.LOG file.
< Installation directory >\odbc_gateway\mycat\logs\mycat.log
Historical logs are archived to subdirectories.
The ODBC API test tool developed by Microsoft can test the ODBC API without writing a line of code. This tool is a part of the MDAC tool package. You can download the tool from https://www.microsoft.com/en-us/download/details.aspx?id=21995
The simba blog provides a more detailed description of how to use it. https://www.simba.com/blog/testing-driver-odbc-test/
The test directory contains a large number of test cases. You can write your own test cases to test or debug code.
This function is compatible with PrestoSQL, PrestoDB and other presto forks with special connection and authentication implementation. It is connected to and authenticated by the server and has been uninstalled to the JDBC driver layer. You can perform secondary adaptation to the JDBC driver implementation layer to support the ODBC of the server.
<dependency>
<groupId>io.hetu.core</groupId>
<artifactId>hetu-jdbc</artifactId>
<version>010</version>
</dependency>
Node: The version may be upgraded, here just an example.
server.xml
<! --
the jdbc url prefix, openLooKeng-> jdbc:lk://, presto-> jdbc:presto://
-->
<property name="jdbcUrlPrefix">jdbc:lk://</property>
wrapper.conf
wrapper.java.additional.XX=
Add new configuration parameters to the file.
Note: Before modifying the configuration items in the mycat directory, stop the mycat service.
Set the customized connection parameters in Connect URL and Connect Config on the DSN configuration page.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。