From 6a5831c4389ebba315a048517999fa982ff01e73 Mon Sep 17 00:00:00 2001 From: zyyang Date: Fri, 5 Mar 2021 15:33:11 +0800 Subject: [PATCH] change --- .../jdbc/src/main/java/com/taosdata/jdbc/TSDBSubscribe.java | 5 ++--- .../jdbc/src/test/java/com/taosdata/jdbc/ResultSetTest.java | 1 - .../jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBSubscribe.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBSubscribe.java index c21a058ba2..dd0d0d5b7b 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBSubscribe.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBSubscribe.java @@ -14,12 +14,11 @@ *****************************************************************************/ package com.taosdata.jdbc; -import javax.management.OperationsException; import java.sql.SQLException; public class TSDBSubscribe { - private TSDBJNIConnector connecter = null; - private long id = 0; + private final TSDBJNIConnector connecter; + private final long id; TSDBSubscribe(TSDBJNIConnector connecter, long id) throws SQLException { if (null != connecter) { diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/ResultSetTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/ResultSetTest.java index fb0053cb4b..87348f9026 100644 --- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/ResultSetTest.java +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/ResultSetTest.java @@ -13,7 +13,6 @@ import java.util.HashMap; import java.util.Properties; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; public class ResultSetTest { static Connection connection; diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java index 685957d60a..8d76bffa20 100644 --- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java @@ -48,7 +48,6 @@ public class SubscribeTest { @Test public void subscribe() { try { - String rawSql = "select * from " + dbName + "." + tName + ";"; System.out.println(rawSql); TSDBSubscribe subscribe = ((TSDBConnection) connection).subscribe(topic, rawSql, false); @@ -67,10 +66,10 @@ public class SubscribeTest { if (a >= 2) { break; } -// resSet.close(); + resSet.close(); } - subscribe.close(true); + subscribe.close(false); } catch (Exception e) { e.printStackTrace(); } -- GitLab