入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

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

创建时间:2009-08-23 投稿人: 浏览次数:10936

存档

 

//获取总记录数
      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。
  • 上一篇:没有了
  • 下一篇:没有了
未上传头像