首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

怎么得到select count(*) from 表 where name='aa'的返回值

2012-03-14 
如何得到select count(*) from 表 where nameaa的返回值?如何得到selectcount(*)from表wherename aa

如何得到select count(*) from 表 where name='aa'的返回值?
如何得到select   count(*)   from   表   where   name= 'aa '的返回值?

[解决办法]
select count(*) as count_value from 表 where name= 'aa '
...

rs.getInt( "count_value ")或者rs.getInt(1)
[解决办法]
rs.getInt(1);
[解决办法]
你提交时用那个返回值是Resultset的statement里的executeQuery方法,提交后用ResultSet对像来接,剩下的你去看Resultset的方法怎么使

热点排行