java 中 从ResultSet获取select count统计结果
存档
//获取总记录数
ResultSet rs = statement.executeQuery("select count(*) from user_info where userid="00000001" and userpass="admin"" );
if (rs.next())
{
//rs.getInt(int columnIndex )-------->columnIndex the first column is 1, the second is 2, ...
recordCount = rs.getInt(1);
}
就是rs.getInt(1)而已!
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇:没有了