日期:2014-05-18  浏览次数:20838 次

如何得到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的方法怎么使