我正在试图从我的查询中获取ResultSet中的数字,如下面的代码中所示。查询检索数字5.我怎样才能从ResultSet中获得这个数字?获取结果集中的行数
代码:
String sql_count_stop = "select count(*) FROM behaviour where mac = ? ";
PreparedStatement preparedCount = con.prepareStatement(sql_count_stop);
preparedCount.setString(1, macD);
ResultSet rsCount = preparedCount.executeQuery();
while(rsCount.next()){
}
ResultSet :: getInt(String)方法有什么问题? –