错误提示:Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:

错误提示:

类型 异常报告

消息 Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:

描述 服务器遇到一个意外的情况,阻止它完成请求。

解决方案:

1、检查dao层xxxMapper.xml文件中的SQL语句是否有语法错误,特别是中英文标点问题

        例如我这里就是SQL语句中英文标点问题:

<insert id="addBook" parameterType="Books">
    insert into ssmbuild.books (bookName,bookCounts,detail)
    values (#{bookName},#{bookCounts},#{detail});
</insert>

2、检查数据库的字段名是否和项目中的配置的设置的字段名(dao层xxxMapper.xml文件中的SQL语句字段名)是否一致(这个也要好好检查

3、检查数据库的链接是否有问题(一般没有问题)

猜你喜欢

转载自blog.csdn.net/qq_51515673/article/details/124135286