【TDengine 使用环境】
生产环境 /测试/ Poc/预生产环境
测试环境
【TDengine 版本】
2.7
【操作系统以及版本】
ubantu
【部署方式】容器/非容器部署
【集群节点数】
【集群副本数】
【描述业务影响】
【问题复现路径/shan】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】
【报错完整截图】
public static void main(String args) throws SQLException {
String jdbcUrl = “jdbc:TAOS-RS://192.168.2.214:6041/demodb”;
String user = “root”;
String password = “taosdata”;
String tableName = “Beijing”;
Long startDate = System.currentTimeMillis();
Connection conn = DriverManager.getConnection(jdbcUrl, user, password);
String sql = String.format("INSERT INTO %s(ts, temperature, humidity) VALUES(?, ?, ?)", tableName);
java.sql.PreparedStatement pstmt = conn.prepareStatement(sql);
for (int i = 0; i < 10000; i++) {
pstmt.setLong(1, startDate + i * 500);
pstmt.setDouble(2, Math.random() * 10);
pstmt.setInt(3, (int) (Math.random() * 100));
pstmt.executeUpdate();
}
pstmt.close();
conn.close();
Long duration = System.currentTimeMillis() - startDate;
System.out.println("✅ end!!!".concat(String.valueOf(duration)));
}