首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

获取JDBC中的ResultSet的记要的条数

2012-07-25 
获取JDBC中的ResultSet的记录的条数?方法一:利用ResultSet的getRow方法来获得ResultSet的总行数 ?String s

获取JDBC中的ResultSet的记录的条数

?

方法一:利用ResultSet的getRow方法来获得ResultSet的总行数

?

String sql = "select count(*) record_ from ( select * from yourtable t where t.column_ = 'value_' )";    ResultSet rs = ps.executeQuery(sql);     int rowCount = 0;     if(rs.next())     {         rowCount=rs.getInt("record_");     }

?

?

?

?

?

?

热点排行