Are there any good CachedRowSet implementations other than the proprietary Sun one?

后端 未结 3 844
Happy的楠姐
Happy的楠姐 2020-12-15 23:17

I am investigating using javax.sql.rowset.CachedRowSet in part of my application, however I can only find information on using the proprietary sun implementation com.sun.row

3条回答
  •  轮回少年
    2020-12-15 23:55

    You shouldn't be directly instantiating implementation of CachedRowSet -- use its Provider to obtain an instance: see http://docs.oracle.com/javase/7/docs/api/javax/sql/rowset/RowSetProvider.html (available since JDK7)

    In fact, CachedRowSet's interface and related factory are standard/portable.

    Something like the following shoud do the trick:

    CachedRowSet crs = RowSetProvider.newFactory().createCachedRowSet();
    crs.populate(myResultSet);
    

提交回复
热议问题