日期:2014-05-20  浏览次数:20743 次

困扰已久的错误:java.sql.SQLException: Invalid SQL statement or JDBC escape,盼高人解决。
错误代码:
HTML code
log4j:ERROR Failed to excute sql
java.sql.SQLException: Invalid SQL statement or JDBC escape, terminating ''' not found.
    at net.sourceforge.jtds.jdbc.SQLParser.parse(SQLParser.java:1155)
    at net.sourceforge.jtds.jdbc.SQLParser.parse(SQLParser.java:156)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:684)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeUpdate(JtdsStatement.java:1166)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeUpdate(JtdsStatement.java:1119)
    at org.apache.log4j.jdbc.JDBCAppender.execute(JDBCAppender.java:178)
    at org.apache.log4j.jdbc.JDBCAppender.flushBuffer(JDBCAppender.java:250)
    at org.apache.log4j.jdbc.JDBCAppender.append(JDBCAppender.java:146)
    at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
    at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
    at org.apache.log4j.Category.callAppenders(Category.java:206)
    at org.apache.log4j.Category.forcedLog(Category.java:391)
    at org.apache.log4j.Category.log(Category.java:856)
    at org.apache.commons.logging.impl.Log4JLogger.warn(Log4JLogger.java:222)
    at com.opensymphony.xwork2.util.logging.commons.CommonsLogger.warn(CommonsLogger.java:56)
    at org.apache.struts2.components.ServletUrlRenderer.renderFormUrl(ServletUrlRenderer.java:186)
    at org.apache.struts2.components.Form.populateComponentHtmlId(Form.java:220)
    at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:784)
    at org.apache.struts2.components.ClosingUIBean.start(ClosingUIBean.java:57)
    at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:53)
    at org.apache.jsp.web.enterprise.add_jsp._jspx_meth_s_005fform_005f0(add_jsp.java:188)
    at org.apache.jsp.web.enterprise.add_jsp._jspx_meth_c_005fif_005f0(add_jsp.java:154)
    at org.apache.jsp.web.enterprise.add_jsp._jspService(add_jsp.java:115)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.yaxing.util.ResFilter.doFilter(ResFilter.java:63)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)