int i=0;
ResultSet r = smt.executeQuery(selCode);
      while(r.next()) { 
      ……
      i++;
}
不就是i的值了?
为什么不在select的时候加个count(*)呢?