Error message: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:

Error message:

Type Exception Report

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

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

solution:

1. Check whether the SQL statement in the dao layer xxxMapper.xml file has grammatical errors, especially Chinese and English punctuation issues

        For example, here is the problem of Chinese and English punctuation in SQL statements:

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

2. Check whether the field name of the database is consistent with the field name set in the configuration of the project (the SQL statement field name in the dao layer xxxMapper.xml file) (this should also be checked carefully )

3. Check if there is any problem with the link of the database (generally there is no problem)

Guess you like

Origin blog.csdn.net/qq_51515673/article/details/124135286