提交 ee85996b 编写于 作者: Z zyyang

change

上级 b346f518
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册