读书人

怎么得到select count(*) from 表 whe

发布时间: 2012-03-14 12:01:12 作者: rapoo

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

读书人网 >Java Web开发

热点推荐