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

您没有登录

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

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to postflat modethreaded modego to previous topicgo to next topicgo to back
作者 SQLServer 2000:Invalid operation for the current cursor position
haiming





发贴: 10
于 2005-10-19 18:05 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
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@include file="opendata.jsp"%>
<%
request.getSession(true);
int month,day,hour,today,total,select;
String time;
String errmsg=request.getParameter("errmsg");
GregorianCalendar calendar;
calendar=new GregorianCalendar();
month=calendar.get(Calendar.MONTH)+1;
day=calendar.get(Calendar.DAY_OF_MONTH);
hour=calendar.get(Calendar.HOUR_OF_DAY);
time="m"+String.valueOf(month)+"d"+String.valueOf(day);
sql="select*from counter where date='"+time+"'";
rs=stmt.executeQuery(sql);
if(!rs.next())
{
sql="insert into counter(date,today,first,secon,third,forth,fifth,sixth)values('"+time+"',0,0,0,0,0,0,0)" ;
rs=stmt.executeQuery(sql);
}
sql="select*from counter where date='"+time+"'";
rs=stmt.executeQuery(sql);
today=rs.getInt(2);
select=(int)Math.floor(hour/4)+1;
sql="select*from total";
rs=stmt.executeQuery(sql);
total=rs.getInt(1);
if(session.isNew())
{
today++;
switch(select)
{
case 1:sql="update counter set today="+today+",first=first+1 where date='"+time+"'";
stmt.executeQuery(sql);
break;
case 2:sql="update counter set today="+today+",secon=secon+1 where date='"+time+"'";
stmt.executeQuery(sql);
break;
case 3:sql="update counter set today="+today+",third=third+1 where date='"+time+"'";
stmt.executeQuery(sql);
break;
case 4:sql="update counter set today="+today+",forth=forth+1 where date='"+time+"'";
stmt.executeQuery(sql);
break;
case 5:sql="update counter set today="+today+",fifth=fifth+1 where date='"+time+"'";
stmt.executeQuery(sql);
break;
case 6:sql="update counter set today="+today+",sixth=sixth+1 where date='"+time+"'";
stmt.executeQuery(sql);

}
total++;
sql="update total set total=total+1";
stmt.executeQuery(sql);
stmt.close();
conn.close();
}
%>
错误:
javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid operation for the current cursor position.
  org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
  org.apache.jsp.count_jsp._jspService(count_jsp.java:180)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


YuLimin edited on 2005-10-20 17:51


25了才开始学JAVA晚吗?

话题树型展开
人气 标题 作者 字数 发贴时间
1711 SQLServer 2000:Invalid operation for the current cursor position haiming 2898 2005-10-19 18:05
1384 Re:SQLServer 2000:Invalid operation for the current cursor position chengbd 74 2005-10-20 23:14

reply to postflat 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