select count(*) from tablename ...

解决方案 »

  1.   

    ……select count(*) as totalCount from TABLENAME……
    …………
    int totalCount=rs.getInt("totalCount");
      

  2.   

    count(*) as totalCount 是不是固定写法,totalCount需要声明吗?
      

  3.   

    jdbc2.0:rs.afterLast();
    int i=rs.getRow();
      

  4.   

    count(*) as  THENAME from TABLENAME
    THENAME 不用声明,意思是把纪录的行数放在THENAME 这个字段里。