插入数据报错

来源:8-2 整合MyBatis - 实现基于mybatis的CRUD功能

慕标605454

2018-09-04 09:03

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Sep 04 08:56:32 CST 2018

There was an unexpected error (type=Internal Server Error, status=500).

### 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 MariaDB server version for the right syntax to use near 'desc,add_time ) VALUES( null,'2222','null','2018-09-04 08:56:32' )' at line 1 ### The error may involve com.agilephotonics.mappers.examination.ExaminationExamcategoryMapper.insert-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO examination_examcategory ( id,name,desc,add_time ) VALUES( ?,?,?,? ) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'desc,add_time ) VALUES( null,'2222','null','2018-09-04 08:56:32' )' at line 1 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'desc,add_time ) VALUES( null,'2222','null','2018-09-04 08:56:32' )' at line 1


写回答 关注

2回答

  • 一叶秋才
    2018-09-14 11:24:34

    看看你的字段类型是否匹配数据库的字段类型

  • maybe丶xg
    2018-09-05 19:22:16

    SQL语法错误?

SpringBoot开发常用技术整合

SpringBoot 极简开发的框架整合利器

102171 学习 · 508 问题

查看课程

相似问题