把它放到数组或Vector中传输。

解决方案 »

  1.   

    http://developer.java.sun.com/developer/earlyAccess/crs/
    JDBCTM RowSet 
    This Early Access release includes three implementations of the JDBCTM RowSet interface. The RowSet interface provides a serializable, scrollable container for tabular data that may or may not be connected to its data source via a JDBC technology-enabled driver. A disconnected RowSet object, such as a CachedRowSet object or a WebRowSet object, can be thought of as a set of rows that are being cached outside of a data source. Because they are lightweight and serializable, disconnected rowsets can be passed between different components of a distributed application, such as Enterprise JavaBeansTM components. This is one of the most important uses for a RowSet object. The data in a RowSet object may be updated and then resynchronized with the underlying tabular data source. The RowSet Early Access Technology Release contains the rowset jar file, preliminary documentation and code examples. Additional documentation on RowSets is contained in the JDBC 2.0 Optional Package API specification. The Java Developer Connection(SM) also provides on-line access to the RowSet tutorial chapter of the new JavaTM series JDBC book. Early Access Release 4 addresses the following areas:fixed problem inserting rows with non-nullable columns 
    re-ordered code in writer to allow multiple changes to a single row to be propogated back to a data source 
    reader/writer now only close connects that they create. This change should allow RowSets to be used with connection pool implementations based on JDBC 1.x drivers 
    included missing EchoListener.java for example 5 
    The three JDBCTM RowSet implementations in this release demonstrate some of the many possibilities for implementing the javax.sql.RowSet interface, which is part of the JDBC 2.0 Optional Package API. The three example implementations in this release are:CachedRowSet -- a rowset that can be used to 
    Send a set of rows across a network 
    Send data to a thin client 
    Add scrollability and updatability to result set data 
    WebRowSet -- an extension of CachedRowSet that can be used to send a rowset across a network in XML format 
    JDBCRowSet -- a rowset that can be used to encapsulate a JDBCTM driver as a Java BeansTM component 
    Developers cannot redistribute the binary software in commercial products. Please see license for terms and conditions. The file Release.notes in the download package contains instructions for installation and setup. NOTE: The three RowSet implementations contained in this release are experimental, unsupported technology. The APIs in this release may change before they become an official part of the JavaTM 2 platform. The sun.jdbc.rowset package, which is contained in this release, is NOT a committed API for the Java platform. 
      

  2.   

    first read it out of the ResultSet and put it into another data type that's actually Serializable.
      

  3.   

    用ROWSET 吧.新JDBC包里面有.
      

  4.   

    http://www.csdn.net/develop/read_article.asp?id=14917
    这篇文章讲了具体应用
      

  5.   

    用LIST中的SORT(你的SET,一个COMPARATOR)
      

  6.   

    把结果放到Collection中,可以迭代
      

  7.   

    ......
    transient ResultSet rs = stmt.executeQuery("SELECT * FROM      EMPLOYEES");
    CachedRowSet crs = new CachedRowSet();
    crs.populate(rs);
    这样就可以序列化了,在反序列化的时候执行相反操作就可以了