diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java index cd2a768a38c377916004875f3f6f143b555a0294..1afd1a3cba2c6eb0ef4fcd32419e80d962d7c038 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBStatement.java @@ -17,6 +17,7 @@ package com.taosdata.jdbc; import java.sql.*; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.TimeUnit; public class TSDBStatement implements Statement { private TSDBJNIConnector connector = null; @@ -67,6 +68,12 @@ public class TSDBStatement implements Statement { // TODO make sure it is not a update query pSql = this.connector.executeQuery(sql); + try { + TimeUnit.SECONDS.sleep(10); + } catch (InterruptedException e) { + e.printStackTrace(); + } + long resultSetPointer = this.connector.getResultSet(); if (resultSetPointer == TSDBConstants.JNI_CONNECTION_NULL) { diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/MultiThreadsWithSameStatmentTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/MultiThreadsWithSameStatmentTest.java index 9427c67f80f02dff023243e5f764dae08ced8348..90f41dade3d527b237b471634cfb9a81f0d930c3 100644 --- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/MultiThreadsWithSameStatmentTest.java +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/MultiThreadsWithSameStatmentTest.java @@ -31,7 +31,6 @@ public class MultiThreadsWithSameStatmentTest { Thread t1 = new Thread(() -> { try { ResultSet resultSet = stmt.executeQuery("select * from jdbctest.weather"); - sleep(5000); while (resultSet.next()) { ResultSetMetaData metaData = resultSet.getMetaData(); for (int i = 1; i <= metaData.getColumnCount(); i++) {