统计符合条件的记录数的语句应该如何写? select count(*) from online where ty="学生" ?是不是我理解有错误,你应该不会问这么简单的问题吧。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select count(*) from online where ty="学生"num=rs(0)'num就是学生鼠了 ResultSet rs="select count(*) from online where ty="学生"";rs.next();int num=rs.getInt(1);num就是学生数了 <jsp:useBean id="workM" scope="page" class="online.onlineconn1" /><%!ResultSet rs5 = null;int num;%><%rs5= workM.executeQuery("select count(*) from onlineuser where sf=1");num=rs5(0);%>报错:An error occurred at line: -1 in the jsp file: nullGenerated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] D:\Tomcat 4\work\Standalone\localhost\test\online\content_jsp.java:89: cannot resolve symbol [javac] symbol : method rs5 (int) [javac] location: class org.apache.jsp.content_jsp [javac] num=rs5(0); [javac] ^ [javac] 1 error modify:rs5= workM.executeQuery("select count(*) from onlineuser where sf=1");rs5.next();//addnum=rs5(0); modify:rs5= workM.executeQuery("select count(*) from onlineuser where sf=1");rs5.next();//addnum=rs5.getInt(1); struts2的保存时间问题 这个代码怎样在jsp中使用 JSP标签问题 问个ssh的问题 JSP与SQL2000的连接问题 为何JasperReports图表在web浏览器中显示空白? jsp页面表格打印问题 散分,为过年不回家的朋友,祝过年快乐,恭喜发财! 送分啦~!在连接到另一框时出了点问题 关于在asp/php/perl/jsp/servlet中共用cookie、session的问题 各位大哥进来看看。我快被它烦死呢!!帮忙看看错在哪!!!分不够大哥们开口就是!!! 谁有java实现的树型的代码?最好是Javabean的形式!!谢谢!
rs.next();
int num=rs.getInt(1);
num就是学生数了
<%!
ResultSet rs5 = null;
int num;
%>
<%
rs5= workM.executeQuery("select count(*) from onlineuser where sf=1");
num=rs5(0);
%>
报错:
An error occurred at line: -1 in the jsp file: nullGenerated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] D:\Tomcat 4\work\Standalone\localhost\test\online\content_jsp.java:89: cannot resolve symbol
[javac] symbol : method rs5 (int)
[javac] location: class org.apache.jsp.content_jsp
[javac] num=rs5(0);
[javac] ^
[javac] 1 error
rs5.next();//add
num=rs5(0);
rs5.next();//add
num=rs5.getInt(1);