diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TaosInfo.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TaosInfo.java index 69a90fe3b378067eda6de0efb2b655d41c49a1da..ee1364ce217c639cbf864f87f83ad6f5ddd6c137 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TaosInfo.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TaosInfo.java @@ -2,7 +2,6 @@ package com.taosdata.jdbc.utils; import javax.management.*; import java.lang.management.ManagementFactory; -import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; public class TaosInfo implements TaosInfoMBean { @@ -17,6 +16,7 @@ public class TaosInfo implements TaosInfoMBean { MBeanServer server = ManagementFactory.getPlatformMBeanServer(); ObjectName name = new ObjectName("TaosInfoMBean:name=TaosInfo"); server.registerMBean(TaosInfo.getInstance(), name); + } catch (MalformedObjectNameException | InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) { e.printStackTrace(); } diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/TaosInfoMonitorTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/TaosInfoMonitorTest.java index 2ab4045e276b3f0891763e63e0285195a45503cc..e9e36e20c4f83e98d6dd808da3a58ee628f418f0 100644 --- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/TaosInfoMonitorTest.java +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/cases/TaosInfoMonitorTest.java @@ -17,7 +17,7 @@ public class TaosInfoMonitorTest { List connectionList = IntStream.range(0, 100).mapToObj(i -> { try { - TimeUnit.SECONDS.sleep(1); + TimeUnit.MILLISECONDS.sleep(100); return DriverManager.getConnection(url); } catch (SQLException | InterruptedException e) { e.printStackTrace(); @@ -31,7 +31,7 @@ public class TaosInfoMonitorTest { while (rs.next()) { } - TimeUnit.MILLISECONDS.sleep(50); + TimeUnit.MILLISECONDS.sleep(100); } catch (SQLException | InterruptedException e) { e.printStackTrace(); } @@ -40,7 +40,7 @@ public class TaosInfoMonitorTest { connectionList.stream().forEach(conn -> { try { conn.close(); - TimeUnit.SECONDS.sleep(1); + TimeUnit.MILLISECONDS.sleep(100); } catch (SQLException | InterruptedException e) { e.printStackTrace(); }