提交 ec85a24c 编写于 作者: Z zyyang

change

上级 fa6bf4d3
......@@ -40,8 +40,10 @@ public class JDBCDemo {
private void init() {
// get connection
try {
String url = "jdbc:TAOS://" + host + ":6030/";
if (driverType.equals("restful")) {
Class.forName("com.taosdata.jdbc.rs.RestfulDriver");
url = "jdbc:TAOS-RS://" + host + ":6041/";
} else {
Class.forName("com.taosdata.jdbc.TSDBDriver");
}
......@@ -51,7 +53,7 @@ public class JDBCDemo {
properties.setProperty("locale", "en_US.UTF-8");
properties.setProperty("timezone", "UTC-8");
System.out.println("get connection starting...");
connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/", properties);
connection = DriverManager.getConnection(url, properties);
if (connection != null)
System.out.println("[ OK ] Connection established.");
} catch (ClassNotFoundException | SQLException e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册