From ee85996beb5e760d93b7ded1cbb7f220eabab830 Mon Sep 17 00:00:00 2001 From: zyyang Date: Wed, 27 Jan 2021 17:51:38 +0800 Subject: [PATCH] change --- .../src/main/java/com/taosdata/example/SubscribeDemo.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/SubscribeDemo.java b/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/SubscribeDemo.java index 0fdfcc51a1..6d036201b3 100644 --- a/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/SubscribeDemo.java +++ b/tests/examples/JDBC/JDBCDemo/src/main/java/com/taosdata/example/SubscribeDemo.java @@ -34,7 +34,6 @@ public class SubscribeDemo { return; } /*********************************************************************************************/ - try { Class.forName("com.taosdata.jdbc.TSDBDriver"); Properties properties = new Properties(); @@ -43,7 +42,7 @@ public class SubscribeDemo { properties.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8"); final String url = "jdbc:TAOS://" + host + ":6030/" + database + "?user=root&password=taosdata"; // get TSDBConnection - TSDBConnection connection = DriverManager.getConnection(url, properties).unwrap(TSDBConnection.class); + TSDBConnection connection = (TSDBConnection) DriverManager.getConnection(url, properties); // create TSDBSubscribe TSDBSubscribe sub = connection.subscribe(topic, sql, false); @@ -66,4 +65,4 @@ public class SubscribeDemo { e.printStackTrace(); } } -} +} \ No newline at end of file -- GitLab