docs: modify jdbc version (#16081)

This commit is contained in:
huolibo 2022-08-13 01:14:38 +08:00 committed by GitHub
parent 46be38457d
commit fdc6c1f035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 18 deletions

View File

@ -41,19 +41,20 @@ Please refer to [Version Support List](/reference/connector#version-support).
TDengine currently supports timestamp, number, character, Boolean type, and the corresponding type conversion with Java is as follows: TDengine currently supports timestamp, number, character, Boolean type, and the corresponding type conversion with Java is as follows:
| TDengine DataType | JDBCType (driver version < 2.0.24) | JDBCType (driver version > = 2.0.24) |
| ----------------- | ---------------------------------- | ------------------------------------ | | TDengine DataType | JDBCType |
| TIMESTAMP | java.lang.Long | java.sql.Timestamp | | ----------------- | ---------------------------------- |
| INT | java.lang.Integer | java.lang.Integer | | TIMESTAMP | java.sql.Timestamp |
| BIGINT | java.lang.Long | java.lang.Long | | INT | java.lang.Integer |
| FLOAT | java.lang.Float | java.lang.Float | | BIGINT | java.lang.Long |
| DOUBLE | java.lang.Double | java.lang.Double | | FLOAT | java.lang.Float |
| SMALLINT | java.lang.Short | java.lang.Short | | DOUBLE | java.lang.Double |
| TINYINT | java.lang.Byte | java.lang.Byte | | SMALLINT | java.lang.Short |
| BOOL | java.lang.Boolean | java.lang.Boolean | | TINYINT | java.lang.Byte |
| BINARY | java.lang.String | byte array | | BOOL | java.lang.Boolean |
| NCHAR | java.lang.String | java.lang.String | | BINARY | byte array |
| JSON | - | java.lang.String | | NCHAR | java.lang.String |
| JSON | java.lang.String |
**Note**: Only TAG supports JSON types **Note**: Only TAG supports JSON types
@ -81,7 +82,7 @@ Add following dependency in the `pom.xml` file of your Maven project:
<dependency> <dependency>
<groupId>com.taosdata.jdbc</groupId> <groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId> <artifactId>taos-jdbcdriver</artifactId>
<version>2.0.**</version> <version>3.0.0</version>
</dependency> </dependency>
``` ```
@ -845,7 +846,13 @@ Please refer to: [JDBC example](https://github.com/taosdata/TDengine/tree/develo
**Cause**: Currently, TDengine only supports 64-bit JDK. **Cause**: Currently, TDengine only supports 64-bit JDK.
**Solution**: Reinstall the 64-bit JDK. 4. **Solution**: Reinstall the 64-bit JDK.
4. java.lang.NoSuchMethodError: setByteArray
**Cause**: taos-jdbcdriver version 3.* only supports TDengine 3.0 or above.
**Solution**: connect TDengine 2.* using taos-jdbcdriver 2.* version.
For other questions, please refer to [FAQ](/train-faq/faq) For other questions, please refer to [FAQ](/train-faq/faq)

View File

@ -83,7 +83,7 @@ Maven 项目中,在 pom.xml 中添加以下依赖:
<dependency> <dependency>
<groupId>com.taosdata.jdbc</groupId> <groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId> <artifactId>taos-jdbcdriver</artifactId>
<version>2.0.**</version> <version>3.0.0</version>
</dependency> </dependency>
``` ```
@ -712,7 +712,7 @@ while(true) {
} }
``` ```
`poll` 方法返回一个结果集,其中包含从上次 `poll` 到目前为止的所有新数据。请务必按需选择合理的调用 `poll` 的频率(如例子中的 `Duration.ofMillis(100)`),否则会给服务端造成不必要的压力。 `poll` 每次调用获取一个消息。请按需选择合理的调用 `poll` 的频率(如例子中的 `Duration.ofMillis(100)`),否则会给服务端造成不必要的压力。
#### 关闭订阅 #### 关闭订阅
@ -900,7 +900,13 @@ public static void main(String[] args) throws Exception {
**解决方法**:重新安装 64 位 JDK。 **解决方法**:重新安装 64 位 JDK。
4. 其它问题请参考 [FAQ](../../../train-faq/faq) 4. java.lang.NoSuchMethodError: setByteArray
**原因**taos-jdbcdriver 3.* 版本仅支持 TDengine 3.0 及以上版本。
**解决方法** 使用 taos-jdbcdriver 2.* 版本连接 TDengine 2.* 版本。
其它问题请参考 [FAQ](../../../train-faq/faq)
## API 参考 ## API 参考