lzh 发表于 2009-3-12 17:43:57

求助:JSP开发mysql应用时发生的问题

本帖最后由 lzh 于 2009-3-12 17:49 编辑

找来找去找不到原因.将中间的count(*)改成其它就行,比如换成字段名.另外就是现在数库据是空的,如果有记录也行.在phpmyadmin中执行该sql语句又没事...返回0错误代码如下:请大侠帮忙看一下...

org.apache.jasper.JasperException: Exception in JSP: /admin/admin_affiche_list.jsp:273270:   271:   //#####################272: ps_SQLCmd="SELECT count(*) FROM article WHERE ArticleType =0" + ps_SQLCmdAdd;273: rs=stmt.executeQuery(ps_SQLCmd);274: if (rs.next())275: {276:    pi_RecCount=rs.getInt(1);Stacktrace:        org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause javax.servlet.ServletException: 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 '-10,10' at line 1        org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)        org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)        org.apache.jsp.admin.admin_005faffiche_005flist_jsp._jspService(admin_005faffiche_005flist_jsp.java:974)        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause 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 '-10,10' at line 1        com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)        com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)        com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)        com.mysql.jdbc.Connection.execSQL(Connection.java:2972)        com.mysql.jdbc.Connection.execSQL(Connection.java:2902)        com.mysql.jdbc.Statement.executeQuery(Statement.java:822)        org.apache.jsp.admin.admin_005faffiche_005flist_jsp._jspService(admin_005faffiche_005flist_jsp.java:784)        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
页: [1]
查看完整版本: 求助:JSP开发mysql应用时发生的问题