1 表结构如下
MySQL [test]> desc t;
±------------±----------±-----±----±------------------±----------------------------+
| Field | Type | Null | Key | Default | Extra |
±------------±----------±-----±----±------------------±----------------------------+
| id | int(11) | NO | PRI | NULL | |
| create_time | timestamp | NO | | CURRENT_TIMESTAMP | |
| update_time | timestamp | NO | | CURRENT_TIMESTAMP | ON UPDATE CURRENT_TIMESTAMP |
±------------±----------±-----±----±------------------±----------------------------+
3 rows in set (0.00 sec)
2 sql语句如下
3 在命令行执行这种sql是ok的,但是使用jdbc 8 版本连接执行却会报语法错误
SQL: UPDATE room SET state = ?, zoo_in_time = ? WHERE id = ? ; UPDATE room SET state = ?, zoo_in_time = ? WHERE id = ?
Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use
org.springframework.jdbc.BadSqlGrammarException:
Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use
The error may involve com.hikvision.building.cloud.neptune.system.biz.domain.mapper.community.RoomMapper.batchUpdateStateByCommunityId-Inline
The error occurred while setting parameters
如果使用jdbc 5 版本才可以解决。请问能不能不降低jdbc驱动版本就能解决问题。
而且一些数据库管理软件都是使用高版本的驱动会导致同样的问题出现。
希望能够不降低驱动版本解决此兼容问题