org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
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 'read(R_No,R_Grade,R_Section,R_Level,R_Content,R_Question1,R_Option1A,R_Option1B,' at line 1
The error may involve com.exam.dao.TeacherDao.readIn-Inline
The error occurred while setting parameters
SQL: insert into read(R_No,R_Grade,R_Section,R_Level,R_Content,R_Question1,R_Option1A,R_Option1B,R_Option1C,R_Option1D,R_Question1Answer,R_Question2,R_Option2A,R_Option2B,R_Option2C,R_Option2D,R_Question2Answer,R_Question3,R_Option3A,R_Option3B,R_Option3C,R_Option3D,R_Question3Answer,R_Question4,R_Option4A,R_Option4B,R_Option4C,R_Option4D,R_Question4Answer,R_Num,R_Time,R_T_Sn) values(default,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,default,?,?)
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 'read(R_No,R_Grade,R_Section,R_Level,R_Content,R_Question1,R_Option1A,R_Option1B,' 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 MySQL server version for the right syntax to use near 'read(R_No,R_Grade,R_Section,R_Level,R_Content,R_Question1,R_Option1A,R_Option1B,' at line 1
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
org.springframework.jdbc.BadSqlGrammarException:
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 'read(R_No,R_Grade,R_Section,R_Level,R_Content,R_Question1,R_Option1A,R_Option1B,' at line 1
The error may involve com.exam.dao.TeacherDao.readIn-Inline
The error occurred while setting parameters
SQL: insert into read(R_No,R_Grade,R_Section,R_Level,R_Content,R_Question1,R_Option1A,R_Option1B,R_Option1C,R_Option1D,R_Question1Answer,R_Question2,R_Option2A,R_Option2B,R_Option2C,R_Option2D,R_Question2Answer,R_Question3,R_Option3A,R_Option3B,R_Option3C,R_Option3D,R_Question3Answer,R_Question4,R_Option4A,R_Option4B,R_Option4C,R_Option4D,R_Question4Answer,R_Num,R_Time,R_T_Sn) values(default,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,default,?,?)
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 'read(R_No,R_Grade,R_Section,R_Level,R_Content,R_Question1,R_Option1A,R_Option1B,' 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 MySQL server version for the right syntax to use near 'read(R_No,R_Grade,R_Section,R_Level,R_Content,R_Question1,R_Option1A,R_Option1B,' at line 1
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
我在写insert语句时候 想往表里插入一条数据,表字段有三十二个,插入时候就出现上面的问题了。 sql语句没有问题,还就是在mysql手动往表里面插入也没有问题,所以我绝得应该是jdbc 对sql语句有限制。不知道有人能解决吗?![图片说明](https://img-ask.csdn.net/upload/201704/08/1491623575_158675.jpg)