未验证 提交 cc4b0737 编写于 作者: H huolibo 提交者: GitHub

[TD-14316]<docs>: add jdbc 2.0.38 doc (#11261)

* [TD-14316]<docs>: add jdbc 2.0.38 doc

* [TD-14316]<docs>: modify format

* [TD-14316]<docs>: add jdbc 2.0.38 doc

* [TD-14316]<docs>: fix doc description

* [TD-14316]<docs>: modify en description

* [TD-14316]<docs> : above to later
上级 e3e34444
...@@ -68,6 +68,7 @@ INSERT INTO test.t1 USING test.weather (ts, temperature) TAGS('beijing') VALUES( ...@@ -68,6 +68,7 @@ INSERT INTO test.t1 USING test.weather (ts, temperature) TAGS('beijing') VALUES(
| taos-jdbcdriver 版本 | TDengine 2.0.x.x 版本 | TDengine 2.2.x.x 版本 | TDengine 2.4.x.x 版本 | JDK 版本 | | taos-jdbcdriver 版本 | TDengine 2.0.x.x 版本 | TDengine 2.2.x.x 版本 | TDengine 2.4.x.x 版本 | JDK 版本 |
| -------------------- | --------------------- | --------------------- | --------------------- | -------- | | -------------------- | --------------------- | --------------------- | --------------------- | -------- |
| 2.0.38 | X | X | 2.4.0.12 以上 | 1.8.x |
| 2.0.37 | X | X | 2.4.0.6 以上 | 1.8.x | | 2.0.37 | X | X | 2.4.0.6 以上 | 1.8.x |
| 2.0.36 | X | 2.2.2.11 以上 | 2.4.0.0 - 2.4.0.5 | 1.8.x | | 2.0.36 | X | 2.2.2.11 以上 | 2.4.0.0 - 2.4.0.5 | 1.8.x |
| 2.0.35 | X | 2.2.2.11 以上 | 2.3.0.0 - 2.4.0.5 | 1.8.x | | 2.0.35 | X | 2.2.2.11 以上 | 2.3.0.0 - 2.4.0.5 | 1.8.x |
...@@ -166,6 +167,16 @@ Connection conn = DriverManager.getConnection(jdbcUrl); ...@@ -166,6 +167,16 @@ Connection conn = DriverManager.getConnection(jdbcUrl);
2. jdbcUrl 以“jdbc:TAOS-RS://”开头; 2. jdbcUrl 以“jdbc:TAOS-RS://”开头;
3. 使用 6041 作为连接端口。 3. 使用 6041 作为连接端口。
从 taos-jdbcdriver-2.0.38 和 TDengine 2.4.0.12 版本开始,**JDBC-RESTful** 的 driver 增加批量拉取数据功能。taos-jdbcdriver 与 TDengine 之间通过 WebSocket 连接进行数据传输。相较于 HTTP,WebSocket 可以使 **JDBC-RESTful** 支持大数据量查询,并提升查询性能。
连接开启批量拉取方式:
```
String url = "jdbc:TAOS-RS://taosdemo.com:6041/?user=root&password=taosdata";Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_BATCH_LOAD, "true");
Connection connection = DriverManager.getConnection(url, properties);
```
如果希望获得更好的写入和查询性能,Java 应用可以使用 **JDBC-JNI** 的 driver,如下所示: 如果希望获得更好的写入和查询性能,Java 应用可以使用 **JDBC-JNI** 的 driver,如下所示:
```java ```java
...@@ -193,7 +204,7 @@ url 中的配置参数如下: ...@@ -193,7 +204,7 @@ url 中的配置参数如下:
- charset:客户端使用的字符集,默认值为系统字符集。 - charset:客户端使用的字符集,默认值为系统字符集。
- locale:客户端语言环境,默认值系统当前 locale。 - locale:客户端语言环境,默认值系统当前 locale。
- timezone:客户端使用的时区,默认值为系统当前时区。 - timezone:客户端使用的时区,默认值为系统当前时区。
- batchfetch: 仅在使用 JDBC-JNI 时生效。true:在执行查询时批量拉取结果集;false:逐行拉取结果集。默认值为:false。 - batchfetch: true:在执行查询时批量拉取结果集;false:逐行拉取结果集。默认值为:false。
- timestampFormat: 仅在使用 JDBC-RESTful 时生效. 'TIMESTAMP':结果集中 timestamp 类型的字段为一个 long 值; 'UTC':结果集中 timestamp 类型的字段为一个 UTC 时间格式的字符串; 'STRING':结果集中 timestamp 类型的字段为一个本地时间格式的字符串。默认值为'STRING'。 - timestampFormat: 仅在使用 JDBC-RESTful 时生效. 'TIMESTAMP':结果集中 timestamp 类型的字段为一个 long 值; 'UTC':结果集中 timestamp 类型的字段为一个 UTC 时间格式的字符串; 'STRING':结果集中 timestamp 类型的字段为一个本地时间格式的字符串。默认值为'STRING'。
- batchErrorIgnore:true:在执行 Statement 的 executeBatch 时,如果中间有一条 sql 执行失败,继续执行下面的 sq 了。false:不再执行失败 sql 后的任何语句。默认值为:false。 - batchErrorIgnore:true:在执行 Statement 的 executeBatch 时,如果中间有一条 sql 执行失败,继续执行下面的 sq 了。false:不再执行失败 sql 后的任何语句。默认值为:false。
......
...@@ -57,6 +57,7 @@ INSERT INTO test.t1 USING test.weather (ts, temperature) TAGS('beijing') VALUES( ...@@ -57,6 +57,7 @@ INSERT INTO test.t1 USING test.weather (ts, temperature) TAGS('beijing') VALUES(
| taos-jdbcdriver 版本 | TDengine 2.0.x.x 版本 | TDengine 2.2.x.x 版本 | TDengine 2.4.x.x 版本 | JDK 版本 | | taos-jdbcdriver 版本 | TDengine 2.0.x.x 版本 | TDengine 2.2.x.x 版本 | TDengine 2.4.x.x 版本 | JDK 版本 |
| -------------------- | --------------------- | --------------------- | --------------------- | -------- | | -------------------- | --------------------- | --------------------- | --------------------- | -------- |
| 2.0.38 | X | X | 2.4.0.12 以上 | 1.8.x |
| 2.0.37 | X | X | 2.4.0.6 以上 | 1.8.x | | 2.0.37 | X | X | 2.4.0.6 以上 | 1.8.x |
| 2.0.36 | X | 2.2.2.11 以上 | 2.4.0.0 - 2.4.0.5 | 1.8.x | | 2.0.36 | X | 2.2.2.11 以上 | 2.4.0.0 - 2.4.0.5 | 1.8.x |
| 2.0.35 | X | 2.2.2.11 以上 | 2.3.0.0 - 2.4.0.5 | 1.8.x | | 2.0.35 | X | 2.2.2.11 以上 | 2.3.0.0 - 2.4.0.5 | 1.8.x |
...@@ -151,7 +152,18 @@ Connection conn = DriverManager.getConnection(jdbcUrl); ...@@ -151,7 +152,18 @@ Connection conn = DriverManager.getConnection(jdbcUrl);
2. jdbcUrl 以“jdbc:TAOS-RS://”开头; 2. jdbcUrl 以“jdbc:TAOS-RS://”开头;
3. 使用 6041 作为连接端口。 3. 使用 6041 作为连接端口。
如果希望获得更好的写入和查询性能,Java 应用可以使用 **JDBC-JNI** 的driver,如下所示: 从 taos-jdbcdriver-2.0.38 和 TDengine 2.4.0.12 版本开始,**JDBC-RESTful** 的 driver 增加批量拉取数据功能。taos-jdbcdriver 与 TDengine 之间通过 WebSocket 连接进行数据传输。相较于 HTTP,WebSocket 可以使 **JDBC-RESTful** 支持大数据量查询,并提升查询性能。
连接开启批量拉取方式:
```
String url = "jdbc:TAOS-RS://taosdemo.com:6041/?user=root&password=taosdata";Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_BATCH_LOAD, "true");
Connection connection = DriverManager.getConnection(url, properties);
```
如果希望获得更好的写入和查询性能,Java 应用可以使用 **JDBC-JNI** 的 driver,如下所示:
```java ```java
Class.forName("com.taosdata.jdbc.TSDBDriver"); Class.forName("com.taosdata.jdbc.TSDBDriver");
String jdbcUrl = "jdbc:TAOS://taosdemo.com:6030/test?user=root&password=taosdata"; String jdbcUrl = "jdbc:TAOS://taosdemo.com:6030/test?user=root&password=taosdata";
...@@ -207,7 +219,7 @@ properties 中的配置参数如下: ...@@ -207,7 +219,7 @@ properties 中的配置参数如下:
* TSDBDriver.PROPERTY_KEY_CHARSET:客户端使用的字符集,默认值为系统字符集。 * TSDBDriver.PROPERTY_KEY_CHARSET:客户端使用的字符集,默认值为系统字符集。
* TSDBDriver.PROPERTY_KEY_LOCALE:客户端语言环境,默认值系统当前 locale。 * TSDBDriver.PROPERTY_KEY_LOCALE:客户端语言环境,默认值系统当前 locale。
* TSDBDriver.PROPERTY_KEY_TIME_ZONE:客户端使用的时区,默认值为系统当前时区。 * TSDBDriver.PROPERTY_KEY_TIME_ZONE:客户端使用的时区,默认值为系统当前时区。
* TSDBDriver.PROPERTY_KEY_BATCH_LOAD: 仅在使用JDBC-JNI时生效。true:在执行查询时批量拉取结果集;false:逐行拉取结果集。默认值为:false。 * TSDBDriver.PROPERTY_KEY_BATCH_LOAD: true:在执行查询时批量拉取结果集;false:逐行拉取结果集。默认值为:false。
* TSDBDriver.PROPERTY_KEY_TIMESTAMP_FORMAT: 仅在使用JDBC-RESTful时生效. 'TIMESTAMP':结果集中timestamp类型的字段为一个long值; 'UTC':结果集中timestamp类型的字段为一个UTC时间格式的字符串; 'STRING':结果集中timestamp类型的字段为一个本地时间格式的字符串。默认值为'STRING'。 * TSDBDriver.PROPERTY_KEY_TIMESTAMP_FORMAT: 仅在使用JDBC-RESTful时生效. 'TIMESTAMP':结果集中timestamp类型的字段为一个long值; 'UTC':结果集中timestamp类型的字段为一个UTC时间格式的字符串; 'STRING':结果集中timestamp类型的字段为一个本地时间格式的字符串。默认值为'STRING'。
* TSDBDriver.PROPERTY_KEY_BATCH_ERROR_IGNORE:true:在执行Statement的executeBatch时,如果中间有一条sql执行失败,继续执行下面的sq了。false:不再执行失败sql后的任何语句。默认值为:false。 * TSDBDriver.PROPERTY_KEY_BATCH_ERROR_IGNORE:true:在执行Statement的executeBatch时,如果中间有一条sql执行失败,继续执行下面的sq了。false:不再执行失败sql后的任何语句。默认值为:false。
......
...@@ -55,15 +55,16 @@ INSERT INTO test.t1 USING test.weather (ts, temperature) TAGS('beijing') VALUES( ...@@ -55,15 +55,16 @@ INSERT INTO test.t1 USING test.weather (ts, temperature) TAGS('beijing') VALUES(
## JDBC driver version and supported TDengine and JDK versions ## JDBC driver version and supported TDengine and JDK versions
| taos-jdbcdriver version | TDengine 2.0.x.x version | TDengine 2.2.x.x version | TDengine 2.4.x.x version | JDK version | | taos-jdbcdriver version | TDengine 2.0.x.x version | TDengine 2.2.x.x version | TDengine 2.4.x.x version | JDK version |
|---------------------| ----------------------| ----------------------| ----------------------| -------- | | ----------------------- | ------------------------ | ------------------------ | ------------------------ | ----------- |
| 2.0.37 | X | X | 2.4.0.6 以上 | 1.8.x | | 2.0.38 | X | X | 2.4.0.12 or later | 1.8.x |
| 2.0.36 | X | 2.2.2.11 以上 | 2.4.0.0 - 2.4.0.5 | 1.8.x | | 2.0.37 | X | X | 2.4.0.6 or later | 1.8.x |
| 2.0.35 | X | 2.2.2.11 以上 | 2.3.0.0 - 2.4.0.5 | 1.8.x | | 2.0.36 | X | 2.2.2.11 or later | 2.4.0.0 - 2.4.0.5 | 1.8.x |
| 2.0.33 - 2.0.34 | 2.0.3.0 以上 | 2.2.0.0 以上 | 2.4.0.0 - 2.4.0.5 | 1.8.x | | 2.0.35 | X | 2.2.2.11 or later | 2.3.0.0 - 2.4.0.5 | 1.8.x |
| 2.0.31 - 2.0.32 | 2.1.3.0 - 2.1.7.7 | X | X | 1.8.x | | 2.0.33 - 2.0.34 | 2.0.3.0 or later | 2.2.0.0 or later | 2.4.0.0 - 2.4.0.5 | 1.8.x |
| 2.0.22 - 2.0.30 | 2.0.18.0 - 2.1.2.1 | X | X | 1.8.x | | 2.0.31 - 2.0.32 | 2.1.3.0 - 2.1.7.7 | X | X | 1.8.x |
| 2.0.12 - 2.0.21 | 2.0.8.0 - 2.0.17.4 | X | X | 1.8.x | | 2.0.22 - 2.0.30 | 2.0.18.0 - 2.1.2.1 | X | X | 1.8.x |
| 2.0.4 - 2.0.11 | 2.0.0.0 - 2.0.7.3 | X | X | 1.8.x | | 2.0.12 - 2.0.21 | 2.0.8.0 - 2.0.17.4 | X | X | 1.8.x |
| 2.0.4 - 2.0.11 | 2.0.0.0 - 2.0.7.3 | X | X | 1.8.x |
## DataType in TDengine and Java connector ## DataType in TDengine and Java connector
...@@ -148,6 +149,16 @@ The JDBC-RESTful does not depend on the local function library. Compared with JD ...@@ -148,6 +149,16 @@ The JDBC-RESTful does not depend on the local function library. Compared with JD
* JdbcUrl starts with "JDBC:TAOS-RS://" * JdbcUrl starts with "JDBC:TAOS-RS://"
* Use port 6041 as the connection port * Use port 6041 as the connection port
JDBC 2.0.38 and later version with TDengine 2.4.0.12 (and later version) start to support a new bulk-pulling feature. It provides higher data transmission performance and larger volume data queries capability via WebSocket communication.
Create bulk-pulling connection:
```
String url = "jdbc:TAOS-RS://taosdemo.com:6041/?user=root&password=taosdata";Properties properties = new Properties();
properties.setProperty(TSDBDriver.PROPERTY_KEY_BATCH_LOAD, "true");
Connection connection = DriverManager.getConnection(url, properties);
```
For better write and query performance, Java applications can use the JDBC-JNI driver, as shown below: For better write and query performance, Java applications can use the JDBC-JNI driver, as shown below:
```java ```java
...@@ -173,7 +184,7 @@ The configuration parameters in the URL are as follows: ...@@ -173,7 +184,7 @@ The configuration parameters in the URL are as follows:
* charset: character set used by the client. The default value is the system character set. * charset: character set used by the client. The default value is the system character set.
* locale: client locale. The default value is the current system locale. * locale: client locale. The default value is the current system locale.
* timezone: timezone used by the client. The default value is the current timezone of the system. * timezone: timezone used by the client. The default value is the current timezone of the system.
* batchfetch: only valid for JDBC-JNI. True if batch ResultSet fetching is enabled; false if row-by-row ResultSet fetching is enabled. Default value is false. * batchfetch: True if batch ResultSet fetching is enabled; false if row-by-row ResultSet fetching is enabled. Default value is false.
* timestampFormat: only valid for JDBC-RESTful. 'TIMESTAMP' if you want to get a long value in a ResultSet; 'UTC' if you want to get a string in UTC date-time format in a ResultSet; 'STRING' if you want to get a local date-time format string in ResultSet. Default value is 'STRING'. * timestampFormat: only valid for JDBC-RESTful. 'TIMESTAMP' if you want to get a long value in a ResultSet; 'UTC' if you want to get a string in UTC date-time format in a ResultSet; 'STRING' if you want to get a local date-time format string in ResultSet. Default value is 'STRING'.
* batchErrorIgnore: true if you want to continue executing the rest of the SQL when error happens during execute the executeBatch method in Statement; false, false if the remaining SQL statements are not executed. Default value is false. * batchErrorIgnore: true if you want to continue executing the rest of the SQL when error happens during execute the executeBatch method in Statement; false, false if the remaining SQL statements are not executed. Default value is false.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册