未验证 提交 9ffd259b 编写于 作者: W wade zhang 提交者: GitHub

Merge pull request #11606 from taosdata/enh/dingbo/java-sample-code

 enh: remove useless perperties from java sample code
package com.taos.example; package com.taos.example;
import com.taosdata.jdbc.TSDBDriver;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Properties;
public class RESTConnectExample { public class RESTConnectExample {
// ANCHOR: main // ANCHOR: main
public static void main(String[] args) throws SQLException { public static void main(String[] args) throws SQLException {
String jdbcUrl = "jdbc:TAOS-RS://localhost:6041?user=root&password=taosdata"; String jdbcUrl = "jdbc:TAOS-RS://localhost:6041?user=root&password=taosdata";
Properties connProps = new Properties(); Connection conn = DriverManager.getConnection(jdbcUrl);
connProps.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
Connection conn = DriverManager.getConnection(jdbcUrl, connProps);
System.out.println("Connected"); System.out.println("Connected");
conn.close(); conn.close();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册