Processing Query Results¶
query method for executing queries to a wrapper returns as a
result an instance of the class
com.denodo.itpilot.client.HTMLWrapperResultIterator. This class
(which implements the interface
asynchronous access to the results of the query made.
Results being accessed in an asynchronous manner means that the server will return results of the query as they are obtained from the source (it is important to remember that the wrapper obtains the data from the source in real time through the network).
hasNext() checks if there are still elements
to return. Due to the asynchronous behavior of this case, this method
must be used before accessing each element, to make sure that data
elements are available.
HTMLWrapperResultIterator obtains the next
result. In this case, each result is an instance of the class
The value associated with each field will be obtained by invoking the method:
com.denodo.vdb.vdbinterface.common.clientResult.vo.sentences.ValueVO getValue (String fieldname)
fieldname is the name of the desired field.
next() will throw an exception of type
NoSuchElementException if there are no available data at that
moment, even if the wrapper still has results to return. Thus the
necessity of using the method
As mentioned in the preceding section, the value of a field can be
atomic or compound. If it is atomic, the instance of
to the subclass
SimpleVO is an abstract class which
subclasses are related to the basic types available in ITPilot:
BlobVO. The subclasses
BooleanVO provide a method
XXX represents the name of the data type) to
access their values. For example,
IntVO provides the method:
In the case of
BlobVO, the following method is provided:
In the case of
DateVO, this is the method:
In addition, the
SimpleVO superclass provides a representation of
the value as a character string accessible through the
method. See Javadoc documentation for detail.
If the value is compound, the instance of
ValueVO could represent an
array of registers (subclass
ArrayVO) or a register (subclass
RegisterVO). In the case of a list of registers the method
ArrayVO.getValues() returns the list of the registers it contains
(instances of the subclass
Page type in ITPilot is represented as a register (subclass
RegisterVO) that contains the following fiels:
- ConnectionType (0: default, 1: MSIE, 3: Denodo Browser): Browser type used to retrieve the page.
- URL: URL of the page.
- Method: HTTP method used to retrieve the page (GET or POST).
- Parameters: HTTP POST parameters used to retrieve the page.
- Cookies: Cookies associated to the page.
See the Javadoc documentation to see more detailed information on the
methods and properties of the class
ValueVO and its subclasses.
Another important aspect of processing queries is dealing with any
errors that may arise (e.g. error connecting to the data source). There
are two methods for this of the class
Boolean checkErrors(). Allows you to check if an error has occurred during query execution. Returns
trueif an error has occurred and
String getErrorDescription(). Where errors have occurred, this allows you to obtain a textual description of it. Otherwise, it returns
null. In wrappers created with versions previous to the 5.5, the custom error messages (no longer supported from version 5.5) are accessed through this method.
getTraceEvents() returns the list of records
RegisterVO) added by wrapper components to the execution trace (see
ITPilot Generation Environment Guide).