这个去java区问不好吗,可能这个区没多少个人知道ResultSet这个类是什么,怎么用了。我没用过这个,看字面是个数据集,你执行了strSQL的这句sql后,存进这个数据集里了,通常数据集都有些rs.getstring('表里的列名')这样的函数读出数据的,但是读出来是什么类型我就不知道了可能也有一些rs.next的函数让你读下一行的。建议移到java区去。

解决方案 »

  1.   

    rs.getXxx(String columnName)或者rs.getXxxx(int columnIndex)
    columnIndex是表中的列号,或者也可以用表的列属性名columnName
    返回的结果是数据类型Xxx,类型Xxx与你定义的数据类型要一致
      

  2.   

    ResultSet返回的是一个数据集.
    一般就这样用
       rs.last();//到最后一条数据记录
      int lastrow=rs.getRow(); //获取最后一条记录行数
      while(rs.next(){
      String title1=rs.getString("title");//获取标题内容
       .............
      }
      

  3.   

    while(rs.next())
    {
      Xxx a=rs.getXxx(int columnIndex);
      或者
      Xxx a=rs.getXxx(String columnName);
    }
      

  4.   

    嗯String getString(int columnIndex) 
              Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language. String getString(String columnName) 
              Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language. 
      

  5.   

    但注意columnIndex第一列的index是1而不是0