docs(driver): jdbc error code (#21114)

This commit is contained in:
huolibo 2023-04-28 11:43:53 +08:00 committed by GitHub
parent 82a053e77e
commit bac5bbc7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 67 additions and 57 deletions

View File

@ -41,7 +41,7 @@ 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 | | TDengine DataType | JDBCType |
| ----------------- | ---------------------------------- | | ----------------- | ------------------ |
| TIMESTAMP | java.sql.Timestamp | | TIMESTAMP | java.sql.Timestamp |
| INT | java.lang.Integer | | INT | java.lang.Integer |
| BIGINT | java.lang.Long | | BIGINT | java.lang.Long |
@ -350,7 +350,12 @@ try (Statement statement = connection.createStatement()) {
} }
``` ```
There are three types of error codes that the JDBC connector can report: - Error code of the JDBC driver itself (error code between 0x2301 and 0x2350), - Error code of the native connection method (error code between 0x2351 and 0x2400), and - Error code of other TDengine function modules. There are four types of error codes that the JDBC connector can report:
- Error code of the JDBC driver itself (error code between 0x2301 and 0x2350),
- Error code of the native connection method (error code between 0x2351 and 0x2360)
- Error code of the consumer method (error code between 0x2371 and 0x2380)
- Error code of other TDengine function modules.
For specific error codes, please refer to. For specific error codes, please refer to.
@ -966,7 +971,7 @@ The source code of the sample application is under `TDengine/examples/JDBC`:
## Recent update logs ## Recent update logs
| taos-jdbcdriver version | major changes | | taos-jdbcdriver version | major changes |
| :---------------------: | :--------------------------------------------: | | :---------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------: |
| 3.1.0 | JDBC REST connection supports subscription over WebSocket | | 3.1.0 | JDBC REST connection supports subscription over WebSocket |
| 3.0.1 - 3.0.4 | fix the resultSet data is parsed incorrectly sometimes. 3.0.1 is compiled on JDK 11, you are advised to use other version in the JDK 8 environment | | 3.0.1 - 3.0.4 | fix the resultSet data is parsed incorrectly sometimes. 3.0.1 is compiled on JDK 11, you are advised to use other version in the JDK 8 environment |
| 3.0.0 | Support for TDengine 3.0 | | 3.0.0 | Support for TDengine 3.0 |
@ -999,9 +1004,9 @@ The source code of the sample application is under `TDengine/examples/JDBC`:
4. java.lang.NoSuchMethodError: setByteArray 4. java.lang.NoSuchMethodError: setByteArray
**Cause**: taos-jbdcdriver 3.* only supports TDengine 3.0 and later. **Cause**: taos-jbdcdriver 3.\* only supports TDengine 3.0 and later.
**Solution**: Use taos-jdbcdriver 2.* with your TDengine 2.* deployment. **Solution**: Use taos-jdbcdriver 2.\* with your TDengine 2.\* deployment.
5. java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer; ... taos-jdbcdriver-3.0.1.jar 5. java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer; ... taos-jdbcdriver-3.0.1.jar

View File

@ -41,7 +41,7 @@ REST 连接支持所有能运行 Java 的平台。
TDengine 目前支持时间戳、数字、字符、布尔类型,与 Java 对应类型转换如下: TDengine 目前支持时间戳、数字、字符、布尔类型,与 Java 对应类型转换如下:
| TDengine DataType | JDBCType | | TDengine DataType | JDBCType |
| ----------------- | ---------------------------------- | | ----------------- | ------------------ |
| TIMESTAMP | java.sql.Timestamp | | TIMESTAMP | java.sql.Timestamp |
| INT | java.lang.Integer | | INT | java.lang.Integer |
| BIGINT | java.lang.Long | | BIGINT | java.lang.Long |
@ -97,7 +97,7 @@ cd taos-connector-jdbc
mvn clean install -Dmaven.test.skip=true mvn clean install -Dmaven.test.skip=true
``` ```
编译后,在 target 目录下会产生 taos-jdbcdriver-3.0.*-dist.jar 的 jar 包,并自动将编译的 jar 文件放在本地的 Maven 仓库中。 编译后,在 target 目录下会产生 taos-jdbcdriver-3.0.\*-dist.jar 的 jar 包,并自动将编译的 jar 文件放在本地的 Maven 仓库中。
</TabItem> </TabItem>
</Tabs> </Tabs>
@ -353,7 +353,12 @@ try (Statement statement = connection.createStatement()) {
} }
``` ```
JDBC 连接器可能报错的错误码包括 3 种JDBC driver 本身的报错(错误码在 0x2301 到 0x2350 之间),原生连接方法的报错(错误码在 0x2351 到 0x2400 之间TDengine 其他功能模块的报错。 JDBC 连接器可能报错的错误码包括 4 种:
- JDBC driver 本身的报错(错误码在 0x2301 到 0x2350 之间)
- 原生连接方法的报错(错误码在 0x2351 到 0x2360 之间)
- 数据订阅的报错(错误码在 0x2371 到 0x2380 之间)
- TDengine 其他功能模块的报错。
具体的错误码请参考: 具体的错误码请参考:
@ -969,7 +974,7 @@ public static void main(String[] args) throws Exception {
## 最近更新记录 ## 最近更新记录
| taos-jdbcdriver 版本 | 主要变化 | | taos-jdbcdriver 版本 | 主要变化 |
| :------------------: | :----------------------------: | | :------------------: | :--------------------------------------------------------------------------------------------: |
| 3.1.0 | WebSocket 连接支持订阅功能 | | 3.1.0 | WebSocket 连接支持订阅功能 |
| 3.0.1 - 3.0.4 | 修复一些情况下结果集数据解析错误的问题。3.0.1 在 JDK 11 环境编译JDK 8 环境下建议使用其他版本 | | 3.0.1 - 3.0.4 | 修复一些情况下结果集数据解析错误的问题。3.0.1 在 JDK 11 环境编译JDK 8 环境下建议使用其他版本 |
| 3.0.0 | 支持 TDengine 3.0 | | 3.0.0 | 支持 TDengine 3.0 |
@ -1002,9 +1007,9 @@ public static void main(String[] args) throws Exception {
4. java.lang.NoSuchMethodError: setByteArray 4. java.lang.NoSuchMethodError: setByteArray
**原因**taos-jdbcdriver 3.* 版本仅支持 TDengine 3.0 及以上版本。 **原因**taos-jdbcdriver 3.\* 版本仅支持 TDengine 3.0 及以上版本。
**解决方法** 使用 taos-jdbcdriver 2.* 版本连接 TDengine 2.* 版本。 **解决方法** 使用 taos-jdbcdriver 2.\* 版本连接 TDengine 2.\* 版本。
5. java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer; ... taos-jdbcdriver-3.0.1.jar 5. java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer; ... taos-jdbcdriver-3.0.1.jar