当前位置: 技术问答>java相关
JSP中的SQL问题!
来源: 互联网 发布时间:2017-03-12
本文导语: 我要在JSP中用到select count(*) as countnum from table where sex='man' 然后利用它的返回的countnum值,我写成了"select count(*) as '" + countnum + "' from table .......",但不正确,请用过的人指教! | sel...
我要在JSP中用到select count(*) as countnum from table where sex='man'
然后利用它的返回的countnum值,我写成了"select count(*) as '" + countnum + "' from table .......",但不正确,请用过的人指教!
然后利用它的返回的countnum值,我写成了"select count(*) as '" + countnum + "' from table .......",但不正确,请用过的人指教!
|
select count(*) as countnum from table where sex='man';
int count=rs.getInt("countnum");
int count=rs.getInt("countnum");