BadSqlGrammarException
An exception occurs when using jdbc query,but it's ok when querying with tdengine client.Can someone tell me why.My tdengine version is 1.6.5.5
it's ok when using tdengine client: taos> select last(ts) as ts,last(P1M1) as P1M1,last(P1M2) as P1M2 from TSN001M1M0; ts | p1m1 | p1m2 |
20-06-29 06:24:00.002| 69.21000| 84.53700| Query OK, 1 row(s) in set (0.003233s)
it's error when using jdbc org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [select last(ts) as ts,last(P1M1) as P1M1,last(P1M2) as P1M2 from TSN001M1M0]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ts) as ts,last(P1M1) as P1M1,last(P1M2) as P1M2 from TSN001M1M0' at line 1
Please update to v1.6.6.0, then try it again.
After updating to version 1.6.6.0, this exception appears when connecting: java.sql.SQLException: TDengine Error: server-client date time unsynced
After updating to version 1.6.6.0, this exception appears when connecting: java.sql.SQLException: TDengine Error: server-client date time unsynced
OK, we'll check it.
please try to use tdengine2.0 and taos-jdbcdriver-2.0.4