楼上说的不全
还应该在con.createStatement(加参数);
用sql语句:
  select count(*)from 表名
就可以了

解决方案 »

  1.   

    用Statement的getMaxRows()返回结果集合中的当前包含的最大行数/
                 getMaxFieldSize()和 SetMaxFieldSize()分别返回和设置结果集合中的组大字段长度
      

  2.   

    Statement stmt = con.createStatement(
                                          ResultSet.TYPE_SCROLL_INSENSITIVE,
                                          ResultSet.CONCUR_UPDATABLE);
           ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
      

  3.   

    用Statement的getMaxRows()返回结果集合中的当前包含的最大行数/
                 getMaxFieldSize()和 SetMaxFieldSize()分别返回和设置结果集合中的组大字段长度public int getMaxRows()
                   throws SQLException
    Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain. If this limit is exceeded, the excess rows are silently dropped.Returns:the current maximum number of rows for a ResultSet object produced by this Statement object; zero means there is no limit
    好像说的不是那个意思