java 中 从ResultSet获取select count统计结果

来源:互联网 发布:淘宝店铺怎么装修页面 编辑:程序博客网 时间:2024/06/05 10:14

存档

 

//获取总记录数
      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)而已!

原创粉丝点击