FAQ(67):java.sql.SQLException: You have an error in your SQL syntax; check the manual that correspon
2018-02-08 01:15
676 查看
1、spring整合springmvc
2、Log:
java.sql.SQLException: 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 'where id=2' at line 1
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2926)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
com.mysql.jdbc.Statement.execute(Statement.java:529)
com.Provider.Dao.ProviderDaoImpl.modify(ProviderDaoImpl.java:157)
com.Provider.Service.ProviderServiceImpl.modify(ProviderServiceImpl.java:36)
com.Provider.Controller.ProviderController.providerModifySave(ProviderController.java:236)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
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)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
解决:
原sql:
update smbms_provider SET proCode='0022',proName='TianMao',proAddress=TianHe,proFax='0213-22',proDesc='KuaiDi',proContact='No33',pic_BusinessLic='D:\java_ee_eclipse\mmb_workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\springmvc5\statics\uploadfilesProvider\1518022014315_Personal.jpg',pic_OrgCodeCer='D:\java_ee_eclipse\mmb_workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\springmvc5\statics\uploadfilesProvider\1518021946950_Personal.jpg',modifyDate='2018-02-08 00:37:12',modifyBy=4,where id=2;
出现2处错误:proAddress字段应该是String,modifyBy=4 后不应该加“,”
修改后sql:
update smbms_provider SET proCode='0022',proName='TianMao',proAddress='TianHe',proFax='0213-22',proDesc='NianHuo',proContact='No33',pic_BusinessLic='D:\java_ee_eclipse\mmb_workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\springmvc5\statics\uploadfilesProvider\1518021733889_Personal.jpg',pic_OrgCodeCer='D:\java_ee_eclipse\mmb_workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\springmvc5\statics\uploadfilesProvider\1518021937800_Personal.jpg',modifyDate='2018-02-08 00:42:05',modifyBy=4 where id=2;
2、Log:
java.sql.SQLException: 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 'where id=2' at line 1
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2926)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
com.mysql.jdbc.Statement.execute(Statement.java:529)
com.Provider.Dao.ProviderDaoImpl.modify(ProviderDaoImpl.java:157)
com.Provider.Service.ProviderServiceImpl.modify(ProviderServiceImpl.java:36)
com.Provider.Controller.ProviderController.providerModifySave(ProviderController.java:236)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
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)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
解决:
原sql:
update smbms_provider SET proCode='0022',proName='TianMao',proAddress=TianHe,proFax='0213-22',proDesc='KuaiDi',proContact='No33',pic_BusinessLic='D:\java_ee_eclipse\mmb_workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\springmvc5\statics\uploadfilesProvider\1518022014315_Personal.jpg',pic_OrgCodeCer='D:\java_ee_eclipse\mmb_workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\springmvc5\statics\uploadfilesProvider\1518021946950_Personal.jpg',modifyDate='2018-02-08 00:37:12',modifyBy=4,where id=2;
出现2处错误:proAddress字段应该是String,modifyBy=4 后不应该加“,”
修改后sql:
update smbms_provider SET proCode='0022',proName='TianMao',proAddress='TianHe',proFax='0213-22',proDesc='NianHuo',proContact='No33',pic_BusinessLic='D:\java_ee_eclipse\mmb_workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\springmvc5\statics\uploadfilesProvider\1518021733889_Personal.jpg',pic_OrgCodeCer='D:\java_ee_eclipse\mmb_workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps\springmvc5\statics\uploadfilesProvider\1518021937800_Personal.jpg',modifyDate='2018-02-08 00:42:05',modifyBy=4 where id=2;
相关文章推荐
- FAQ(55):java.sql.SQLException: You have an error in your SQL syntax; check the manual that correspon
- java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for
- 1064 - You have an error in your SQL syntax; check the manual that correspon解决办法
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
- Hibernate操作MySQL使用reserved word引发错误: “You have an error in your SQL syntax; check the manual that co
- SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ve
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL的问题
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- 利用Mysql进行update时,出现You have an error in your SQL syntax check the manual that corresponds to your My
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s
- ssh开发中插入数据时遇到 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
- asp.net mysql无法查询中文;You have an error in your SQL syntax; check the manual that corresponds to
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds...错误解决方案
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version