Skip to content

Commit

Permalink
[doc](jdbc) add recommended jdbc driver version (apache#26866)
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman authored Nov 13, 2023
1 parent 9c6c2f7 commit d71104f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 23 deletions.
19 changes: 18 additions & 1 deletion docs/en/docs/lakehouse/multi-catalog/jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,23 @@ DROP CATALOG <catalog_name>;
SELECT * FROM <table_name>;
```

## JDBC Drivers

It is recommended to use the following versions of Driver to connect to the corresponding database. Other versions of the Driver have not been tested and may cause unexpected problems.

| Source | JDBC Driver Version |
|:--------:|:--------:|
| MySQL 5.x | mysql-connector-java-5.1.47.jar |
| MySQL 8.x | mysql-connector-java-8.0.25.jar |
| PostgreSQL | postgresql-42.5.1.jar |
| Oracle | ojdbc8.jar|
| SQLServer | mssql-jdbc-11.2.3.jre8.jar |
| Doris | mysql-connector-java-5.1.47.jar / mysql-connector-java-8.0.25.jar |
| Clickhouse | clickhouse-jdbc-0.4.2-all.jar |
| SAP HAHA | ngdbc.jar |
| Trino/Presto | trino-jdbc-389.jar / presto-jdbc-0.280.jar |
| OceanBase | oceanbase-client-2.4.2.jar |

## FAQ

1. Are there any other databases supported besides MySQL, Oracle, PostgreSQL, SQLServer, ClickHouse, SAP HANA, Trino and OceanBase?
Expand Down Expand Up @@ -798,4 +815,4 @@ DROP CATALOG <catalog_name>;
You can download the [lz4-1.3.0.jar](https://repo1.maven.org/maven2/net/jpountz/lz4/lz4/1.3.0/lz4-1.3.0.jar) package first, and then put it in DorisFE lib directory and BE's `lib/lib/java_extensions` directory (versions before Doris 2.0 need to be placed in BE's lib directory).
Starting from version 2.0.2, this file can be placed in the `custom_lib/` directory of FE and BE (if it does not exist, just create it manually) to prevent the file from being lost due to the replacement of the lib directory when upgrading the cluster.
Starting from version 2.0.2, this file can be placed in the `custom_lib/` directory of FE and BE (if it does not exist, just create it manually) to prevent the file from being lost due to the replacement of the lib directory when upgrading the cluster.
61 changes: 39 additions & 22 deletions docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,29 @@ set enable_odbc_transcation = true;

* mysql 5.7

```sql
CREATE CATALOG jdbc_mysql PROPERTIES (
"type"="jdbc",
"user"="root",
"password"="123456",
"jdbc_url" = "jdbc:mysql://127.0.0.1:3306/demo",
"driver_url" = "mysql-connector-java-5.1.47.jar",
"driver_class" = "com.mysql.jdbc.Driver"
)
```
```sql
CREATE CATALOG jdbc_mysql PROPERTIES (
"type"="jdbc",
"user"="root",
"password"="123456",
"jdbc_url" = "jdbc:mysql://127.0.0.1:3306/demo",
"driver_url" = "mysql-connector-java-5.1.47.jar",
"driver_class" = "com.mysql.jdbc.Driver"
)
```

* mysql 8

```sql
CREATE CATALOG jdbc_mysql PROPERTIES (
"type"="jdbc",
"user"="root",
"password"="123456",
"jdbc_url" = "jdbc:mysql://127.0.0.1:3306/demo",
"driver_url" = "mysql-connector-java-8.0.25.jar",
"driver_class" = "com.mysql.cj.jdbc.Driver"
)
```
```sql
CREATE CATALOG jdbc_mysql PROPERTIES (
"type"="jdbc",
"user"="root",
"password"="123456",
"jdbc_url" = "jdbc:mysql://127.0.0.1:3306/demo",
"driver_url" = "mysql-connector-java-8.0.25.jar",
"driver_class" = "com.mysql.cj.jdbc.Driver"
)
```

#### 层级映射

Expand Down Expand Up @@ -371,7 +371,7 @@ CREATE CATALOG jdbc_sqlserve PROPERTIES (

### Doris

Jdbc Catalog也支持连接另一个Doris数据库
Jdbc Catalog 也支持连接另一个Doris数据库

* mysql 5.7 Driver

Expand Down Expand Up @@ -664,6 +664,23 @@ DROP CATALOG <catalog_name>;
SELECT * FROM <table_name>;
```

## JDBC Driver 列表

推荐使用以下版本的 Driver 连接对应的数据库。其他版本的 Driver 未经测试,可能导致非预期的问题。

| Source | JDBC Driver Version |
|:--------:|:--------:|
| MySQL 5.x | mysql-connector-java-5.1.47.jar |
| MySQL 8.x | mysql-connector-java-8.0.25.jar |
| PostgreSQL | postgresql-42.5.1.jar |
| Oracle | ojdbc8.jar|
| SQLServer | mssql-jdbc-11.2.3.jre8.jar |
| Doris | mysql-connector-java-5.1.47.jar / mysql-connector-java-8.0.25.jar |
| Clickhouse | clickhouse-jdbc-0.4.2-all.jar |
| SAP HAHA | ngdbc.jar |
| Trino/Presto | trino-jdbc-389.jar / presto-jdbc-0.280.jar |
| OceanBase | oceanbase-client-2.4.2.jar |

## 常见问题

1. 除了 MySQL,Oracle,PostgreSQL,SQLServer,ClickHouse,SAP HANA,Trino/Presto,OceanBase 是否能够支持更多的数据库
Expand Down Expand Up @@ -799,4 +816,4 @@ DROP CATALOG <catalog_name>;
可以先下载[lz4-1.3.0.jar](https://repo1.maven.org/maven2/net/jpountz/lz4/lz4/1.3.0/lz4-1.3.0.jar)包,然后放到DorisFE lib 目录以及BE 的 `lib/lib/java_extensions`目录中(Doris 2.0 之前的版本需放到 BE 的 lib 目录下)。
从 2.0.2 版本起,可以将这个文件放置在 FE 和 BE 的 `custom_lib/` 目录下(如不存在,手动创建即可),以防止升级集群时因为 lib 目录被替换而导致文件丢失。
从 2.0.2 版本起,可以将这个文件放置在 FE 和 BE 的 `custom_lib/` 目录下(如不存在,手动创建即可),以防止升级集群时因为 lib 目录被替换而导致文件丢失。

0 comments on commit d71104f

Please sign in to comment.