你可以返回一个Vector对象出来。或者使用RowSet来解决。

解决方案 »

  1.   

    public static RowSet getRowSet(String sql)throws SQLException{
         CachedRowSet rowset=null;
         ResultSet rs =null;
         Statement statement=null;
         if ((sql==null)||(sql.equals(""))) {
           throw new java.sql.SQLException("SQL语句是空的!");
         }
         try {
           statement = conn.createStatement();
           rs = statement.executeQuery(sql);
           rowset=new sun.jdbc.rowset.CachedRowSet();
           rowset.populate(rs);
         }catch (SQLException ex) {
           throw new java.sql.SQLException("数据库连接查询错误!"+ex);
         }
         finally {
           try{
             if(statement!=null)statement.close();
             }catch(Exception e){   }
         }
         return rowset;
       }得到rowset对象
      

  2.   

    这个帖子好眼熟,哦,在chinajavaworld上