Translating SQLException with SQL state '42000', error code '1064', message [You have an error in yo

来源:互联网 发布:java excel 图表插件 编辑:程序博客网 时间:2024/05/22 04:47

概述:

尴尬自动生成代码都有错误,很郁闷,最后发现用了mysql的保留字 desc

[org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - Translating SQLException with SQL state '42000', error code '1064', message [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 'desc )      values ( '00aaaaaaaaaaaaaa',                    '26208',      ' at line 11]; SQL was [] for task [### Error updating database.  Cause: 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 'desc )      values ( '00aaaaaaaaaaaaaa',                    '26208',      ' at line 11### The error may involve com.rinlink.intelligent.DAO.LockStatusDAO.insertSelective-Inline### The error occurred while setting parameters### SQL: insert into lock_status      ( device_id,                       serial_num,                       status,                       desc )       values ( ?,                       ?,                       ?,                       ? )### Cause: 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 'desc )      values ( '00aaaaaaaaaaaaaa',                    '26208',      ' at line 11][com.rinlink.intelligent.socket.parser.ParserDispatch] - 解析过程失败

mysql保留字参考如下:

http://luanxiyuan.iteye.com/blog/2224331 

阅读全文
0 0
原创粉丝点击