The
Extensible Query Language (XQL) result set feature allows you to
access query results as objects, rather than as strings, and to
extract SQL base types easily from an XML document, without parsing
results or writing code. The XQL engine is written in Java, so creating
a Java object is easy. The engine encapsulates results in the Java
class com.sybase.xml.xql.XqlResults.SybXqlResult and
its methods.
Table 5-15: com.sybase.xml.xql.Xql.results.SybXqlResult specified methods
Method
|
Action
|
next()
|
Moves marker to the next item in the
result set.
|
getXML()
|
Gets the current item in the result set
and returns it as a java.lang.String object.
If the internal marker is set to 0, this method returns the whole
result set as java.lang.String.
|
getDOM()
|
Gets
the current item in the result set and returns it as an org.w3c.Document
getDOM() object. If the internal marker
is set to 0, this method returns the whole result set as org.w3c.Document.
|
getString()
|
Gets the current item in the result set
and returns it as a java.lang.String object.
If the current item has nested elements, this method generates an
exception.
|
getInt()
|
Gets the current item in the result set
and returns it as an integer. If the current item has nested elements
or cannot be cast as an integer, this method generates an exception.
|
getDouble()
|
Gets the current item in the result set
and returns it as a double. If the current item has nested elements
or cannot be cast as a double, this method generates an exception.
|
getFloat()
|
Gets the current item in the result set
and returns it as a float. If the current item has nested elements or
cannot be cast as a float, this method generates an exception.
|
reset()
|
Resets the internal marker to 0, which
means that immediate calls to getDOM() or getXML() yield the
entire result set as either java.lang.String or org.w3c.Document object.
Calling reset() reinitializes the result set
marker.
|
isFirst()
|
Returns true if the
current item is the first item in the result set.
|
isLast()
|
Returns true if the
current item is the last item in the result set.
|