我的代码是这样的:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn= DriverManager.getConnection(url,user,pw);
Statement stmt=conn.createStatement();
String id=request.getParameter("chapters");
String id2=request.getParameter("theme");
String s="select count(*) as n1 from 单选题 where 章节='"+id+"' and 科目='"+id2+"'";
String bdx="select count(*) as n2 from 不定项 where 章节='"+id+"' and 科目='"+id2+"'";
String pdt="select count(*) as n3 from 判断题 where 章节='"+id+"' and 科目='"+id2+"'";
String mcjs="select count(*) as n4 from 名词解释 where 章节='"+id+"' and 科目='"+id2+"'";
String tkt="select count(*) as n5 from 填空题 where 章节='"+id+"' and 科目='"+id2+"'";
String jdt="select count(*) as n6 from 简答题 where 章节='"+id+"' and 科目='"+id2+"'";
String rst="select count(*) as n7 from 论述题 where 章节='"+id+"' and 科目='"+id2+"'";
ResultSet s1=stmt.executeQuery(s);
s1.next();
int ns1=s1.getInt("n1");
out.print(ns1);
...............................
................................
ResultSet s2=stmt.executeQuery(bdx);
s2.next();
int ns2=s2.getInt("n2");
out.print(ns2);
问题是:
这样编译的话就定死了,java占CPU百分之90多
去掉s2.next();
又提示没有找到定点光标
有没有人知道的说一声音好吗,很急