超级表TAGS中文数据问题
TDengine 2.0.2.1,Centos7 TDengine shell from Linux, Client Version:2.0.2.1 JDBC:Windows10+TDengine-client-2.0.2.1-Windows-x64
超级表创建使用官网示例: CREATE TABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);
taos执行如下语句: 1)INSERT INTO d1001 USING METERS TAGS ("北京.Chaoyang", 2) VALUES (now, 10.2, 219, 0.38); 2)INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 10.2, 219, 0.38); 执行正常,数据正常
JDBC执行 1)报错:TDengine Error: Invalid SQL statement 2) 正常
补充:JDBC 执行插入语句需要先执行"use dbName" 不使用use,直接采用METERS或dbName.METERS执行报错:Database not specified or available
TAGS中的列定义,binary和NCHAR同样的现象。
JDBC用的什么版本?
<dependency>
<groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId>
<version>2.0.4</version>
</dependency>
PreparedStatement ps = con.prepareStatement(sql);
ps.executeUpdate() 改为 ps.execute(sql);
问题解决。