0

So I already understand what a CachedRowSet is. Mainly it holds the data as opposed to other RowSets/ResultSets which require a connection and retrieve the data each time. Since it does not require a connection, it is serializable, and I quote from Java SE 8 documentation of CachedRowSet

A CachedRowSet object is a container for rows of data that caches its rows in memory, which makes it possible to operate without always being connected to its data source. Further, it is a JavaBeans™ component and is scrollable, updatable, and serializable.

I have searched to documentation to the best of my abilities and if it is serializable, it must implement the serializable interface directly or indirectly higher up the hierarchy. I do not see that, so I am confused about how it is serializable without serializable implementation.

George Xavier
  • 191
  • 2
  • 12
  • Well, that rowset being serializable probably is as much part of a contract at it being a bean etc. If you have a look at the implementations they often implement `Serializable` but that isn't a requirement. After all there are other ways to serialize an object than via Java's (old) serialization technology, e.g. text based formats such as json. As an example the interface `WebRowSet` which extends `CachedRowSet` defines XML to be the serialization format. – Thomas Jul 02 '19 at 14:28
  • @Thomas so is it up to the programmer what serialization method to use? – George Xavier Jul 02 '19 at 14:29
  • 1
    I'd say it's up to the implementation of that interface what serialization methods are supported/used. – Thomas Jul 02 '19 at 15:20

0 Answers0