org.springframework.dao.InvalidDataAccessResourceUsageException

来源:互联网 发布:网络通信软件有哪些 编辑:程序博客网 时间:2024/06/06 01:53

org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement

 如上边所示,完成的报错提示就是这样的,附上错误提示的原因:

Caused by: org.hibernate.exception.SQLGrammarException: could not execute statement


Caused by: 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 'group, model_name) values ('25', '?±', 'G1', 'è?????')' at line 1


这样就很清楚我的错误提示了。现在进入问题解释


看到上边的错误提示,那么很直接的就想到 ?± 这个是什么东西,本质的是要的±,但o那个,出现了一个?,怎么造成的?是不是这个算做了特殊符号造成的添加不进入数据?很抱歉不是。那么乱码呢?乱码可以存到数据库中,但是,左思右想,也不知道问题出在哪里了。索性,把可能出现的问题,全部都替换掉。但是,还有这个问题。没办法,上网搜索吧,大部分解释是:

1.字段名写错了,或者是表名写错了,总之基本上是因为在sql语句中,字段名与表不对应,等等.....

2.那就是我的错误的原因了。是因为sql语句中包含了关键字。不注意,造成的问题。基本与上述问题差不多。


那么,现在记录一下,防止以后再犯相同的错误。


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