MariaDB社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3098|回复: 0
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
1#
发表于 2009-3-12 17:43:57 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 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.
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享分享 分享淘帖 顶 踩
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|MariaDB社区 ( 京ICP备07012489号    |
业务联系: QQ:48474881; 邮箱: 48474881@qq.com; 电话:13911732319
声明:本站部分文章是网友转载,若未经作者同意或署名有误,请联系网站管理员。

GMT+8, 2024-11-25 10:34 , Processed in 0.056026 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表