diff --git a/docs/en/14-reference/03-connector/04-java.mdx b/docs/en/14-reference/03-connector/04-java.mdx index 9376850d3ed107fd334c039d9d709b3c0bc0a3c3..ebd2891a9ee444b4c1649385bb94b35b698cc52d 100644 --- a/docs/en/14-reference/03-connector/04-java.mdx +++ b/docs/en/14-reference/03-connector/04-java.mdx @@ -425,7 +425,7 @@ while(resultSet.next()){ This reqId can be used to request link tracing. -``` +```java AbstractStatement aStmt = (AbstractStatement) connection.createStatement(); aStmt.execute("create database if not exists db", 1L); aStmt.executeUpdate("use db", 2L); @@ -955,7 +955,7 @@ public class SchemalessWsTest { This reqId can be used to request link tracing. -``` +```java writer.write(lineDemo, SchemalessProtocolType.LINE, SchemalessTimestampType.NANO_SECONDS, 1L); ``` @@ -1016,7 +1016,7 @@ while(true) { #### Assignment subscription Offset -``` +```java long position(TopicPartition partition) throws SQLException; Map position(String topic) throws SQLException; Map beginningOffsets(String topic) throws SQLException; @@ -1027,7 +1027,7 @@ void seek(TopicPartition partition, long offset) throws SQLException; Example usage is as follows. -``` +```java String topic = "offset_seek_test"; Map offset = null; try (TaosConsumer consumer = new TaosConsumer<>(properties)) { diff --git a/docs/zh/08-connector/14-java.mdx b/docs/zh/08-connector/14-java.mdx index 7b22055c622ac8f9e39b00c5a798ad8bc96a5610..27b732b8835c2290c6cc1e55c35cb6e69f3b957d 100644 --- a/docs/zh/08-connector/14-java.mdx +++ b/docs/zh/08-connector/14-java.mdx @@ -428,7 +428,7 @@ while(resultSet.next()){ 此 reqId 可用于请求链路追踪。 -``` +```java AbstractStatement aStmt = (AbstractStatement) connection.createStatement(); aStmt.execute("create database if not exists db", 1L); aStmt.executeUpdate("use db", 2L); @@ -958,7 +958,7 @@ public class SchemalessWsTest { 此 reqId 可用于请求链路追踪。 -``` +```java writer.write(lineDemo, SchemalessProtocolType.LINE, SchemalessTimestampType.NANO_SECONDS, 1L); ``` @@ -1019,7 +1019,7 @@ while(true) { #### 指定订阅 Offset -``` +```java long position(TopicPartition partition) throws SQLException; Map position(String topic) throws SQLException; Map beginningOffsets(String topic) throws SQLException; @@ -1030,7 +1030,7 @@ void seek(TopicPartition partition, long offset) throws SQLException; 示例代码: -``` +```java String topic = "offset_seek_test"; Map offset = null; try (TaosConsumer consumer = new TaosConsumer<>(properties)) {