日期:2014-05-17  浏览次数:20615 次

获取某个值的数量
sql语句:Select Count(*) From seltopic Where TopicId=1,我得到了所有关于表中TopicId=1的值的数量,请问我怎么在JSP页面中的到这个数量呢?

------解决方案--------------------
String t=(String)(Select Count(*) From seltopic Where TopicId=1),
session.setAtribute("topicid",t);
然后在jsp中调用String s=session.getAtribute(topicid);即可