A ControllerResultSet is a lightweight ResultSet for the
controller side. It only contains row data and column metadata. The real
ResultSet is constructed on by the driver (DriverResultSet object) on the
client side from the ControllerResultSet information.
author: Emmanuel Cecchet version: 1.0
initSerializers() Initialize serializers based on the analysis of actual Java Objects of the
ResultSet to send (typically issued by backend's driver readObject()
method).
Build a Sequoia ResultSet from a database specific ResultSet. The metadata
can be retrieved from the MetadataCache if provided. If a metadata cache is
provided but the data is not in the cache, the MetadataCache is updated
accordingly. The remaining code is a straightforward copy of both metadata
and data. Used for actual queries, as opposed to metadata ResultSets.
The statement used to execute the query will be closed when the ResultSet
has been completely copied or when the ResultSet is closed while in
streaming mode.
Parameters: request - Request to which this ResultSet belongs Parameters: rs - The database specific ResultSet Parameters: metadataCache - MetadataCache (null if none) Parameters: s - Statement used to get rs Parameters: isPartOfMultipleResults - true if this ResultSet is part of a call toa query that returns multiple ResultSets throws: SQLException - if an error occurs
Creates a new ControllerResultSet object from already built
data. Used for ResultSets holding metadata.
Parameters: fields - ResultSet metadata fields Parameters: data - ResultSet data (an ArrayList of Object[] representing rowcontent)
Sets the fetch size and calls fetchData()
Parameters: fetchSizeParam - the number of rows to fetch throws: SQLException - if an error occurs See Also:ControllerResultSet.fetchData()
Fetch the next rows of data from dbResultSet according to fetchSize and
maxRows parameters. This methods directly updates the data and hasMoreData
fields returned by getData() and hadMoreData() accessors.
throws: SQLException - from the backend or if dbResultSet is closed. Maybe weshould use a different type internally.
Initialize serializers based on the analysis of actual Java Objects of the
ResultSet to send (typically issued by backend's driver readObject()
method). MUST be called before #sendToStream()
throws: NotImplementedException - in case we don't know how to serializesomething
Serialize only rows, not any metadata. Useful for streaming. Called by the
controller side. This method MUST mirror the following deserialization
method:
org.continuent.sequoia.driver.DriverResultSet.receiveRows Parameters: output - destination stream throws: IOException - on stream error