Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to topicflat modethreaded modego to previous topicgo to next topicgo to back
作者 500 Servlet Exception
sdlwhb





发贴: 12
于 2006-05-07 18:25 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
java.sql.SQLException: Illegal operation on empty result set
  at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java:3617)
  at com.mysql.jdbc.ResultSet.getString(ResultSet.java:1772)
  at com.mysql.jdbc.ResultSet.getString(ResultSet.java:1837)
  at _reg._login__jsp._jspService(/reg/info/grade.jsp:54)
  at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
  at com.caucho.jsp.Page.subservice(Page.java:506)
  at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
  at com.caucho.server.http.Invocation.service(Invocation.java:315)
  at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
  at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
  at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
  at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
  at java.lang.Thread.run(Thread.java:534)

------------------------------------------------------------------------------------------------
能不能看出是哪里的错误?



作者 Re:500 Servlet Exception [Re:sdlwhb]
sunjavaduke

乒乓球国手-张怡宁



发贴: 176
于 2006-05-07 18:44 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Illegal operation on empty result set
这不是写得很清楚吗
应该是你的结果集对象(ResultSet)是没有任何结果的
也就是说
stmt.excuteQuery(sql);方法返回了一个空的结果集,那么你对这个对象进行操作的话,当然是非法的了



-----------------------------------------------------------------
icd.Neusoft Co,.Ltd.
mail:zhangzhongl@neusoft.com
tel:13591718127
QQ:176932855
------------------------------------------------------------------
作者 Re:500 Servlet Exception [Re:sdlwhb]
sdlwhb





发贴: 12
于 2006-05-07 20:31 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
rs=stmt.executeQuery("SELECT * from users where username ='"+username+"'");
看来问题就在这了,谢谢你哦,不过怎么改呢?



作者 Re:500 Servlet Exception [Re:sdlwhb]
sdlwhb





发贴: 12
于 2006-05-07 20:32 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
users 里面有值的啊


作者 Re:500 Servlet Exception [Re:sdlwhb]
wbfeixue





发贴: 2
于 2006-05-10 13:08 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
看看数据库吧,你的名称对不对???
输入的username对不对???



作者 Re:500 Servlet Exception [Re:sdlwhb]
wbfeixue





发贴: 2
于 2006-05-10 13:09 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我最近也做了一个类似的
中间也出现了这个问题
页面提交的信息有问题



作者 Re:500 Servlet Exception [Re:sdlwhb]
damondeng





发贴: 15
于 2006-05-10 14:35 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
可以考虑将你的查询语句System.out.println出来, 确认这个语句能查到东西, 最好print来出后拷贝到数据库客户端上手工试一下.

如果手工是对的, 程序查就不对的话, 给数据库厂商报个bug吧, 说不定人家重谢你, 呵呵




reply to topicflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923