org.apache.xalan.lib.sql
Class Row

java.lang.Object
  |
  +--org.apache.xml.utils.UnImplNode
        |
        +--org.apache.xalan.lib.sql.StreamableNode
              |
              +--org.apache.xalan.lib.sql.Row

public class Row
extends StreamableNode

This class represents a row from a query result set. The row object can be accessed in one of two modes. Streaming or cached.

In streaming mode, the same Row object is used to represent sequential database rows. Streaming mode only supports traversing the Document once.

In cached mode, as the Document is traversed a new Row objec is created for each database row and a full Document is built. Cached mode allows the Document to be traversed many times.

If you are only traversing the Document once transfering the contents to the result tree, the streaming mode is the better option. The memory footprint is much less. Also streaming mode may be required for database queries that return a large number of rows because the memory footprint is limited to one row.

Caching is controlled by two methods on the XConnection object called enableCacheNodes() or disableCacheNodes().


Constructor Summary
Row(XStatement statement, RowSet parent, Row prev)
          Constructor Row
 
Method Summary
 Node getFirstChild()
          Return the first col element for the current row.
 Node getNextSibling()
          Return next row in the row-set.
 java.lang.String getNodeName()
          Return node name: "row".
 Document getOwnerDocument()
          The parent of a row is #Document represented by XStatement).
 Node getParentNode()
          Return the RowSet parent.
 Node getPreviousSibling()
          Allow us to walk back up the tree
 boolean hasChildNodes()
          Tell if the row Node has any children (col Nodes), which should always be true.
 
Methods inherited from class org.apache.xalan.lib.sql.StreamableNode
getAttributes, getLength, getLocalName, getNamedItem, getNamedItemNS, getNamespaceURI, getNodeTest, getNodeType, getPrefix, getUid, getXStatement, incermentOrderIndex, isSupported, item, removeNamedItem, removeNamedItemNS, setNamedItem, setNamedItemNS, setNodeTest
 
Methods inherited from class org.apache.xml.utils.UnImplNode
appendChild, appendData, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, error, error, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildNodes, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getLastChild, getNodeValue, getOwnerElement, getSpecified, getTagName, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertBefore, insertData, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, replaceData, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setNodeValue, setPrefix, setValue, splitText, substringData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Row

public Row(XStatement statement,
           RowSet parent,
           Row prev)
Constructor Row
Parameters:
statement - Owning document
parent - parent node, a row-set
prev, - the previous node in the row-set
Method Detail

getOwnerDocument

public Document getOwnerDocument()
The parent of a row is #Document represented by XStatement).
Returns:
The owning document
Overrides:
getOwnerDocument in class StreamableNode

getNodeName

public java.lang.String getNodeName()
Return node name: "row".
Returns:
"row".
Overrides:
getNodeName in class UnImplNode

getFirstChild

public Node getFirstChild()
Return the first col element for the current row.
Returns:
the first col element for the current row or null if none
Overrides:
getFirstChild in class UnImplNode

getNextSibling

public Node getNextSibling()
                    throws DOMException
Return next row in the row-set. Use the same Row object over and over if the row-set is streamable.
Returns:
next row in the row-set or null if none
Throws:
Exception, - Force the XConnection to handle all errors
Overrides:
getNextSibling in class UnImplNode

getPreviousSibling

public Node getPreviousSibling()
Allow us to walk back up the tree
Overrides:
getPreviousSibling in class UnImplNode

getParentNode

public Node getParentNode()
Return the RowSet parent.
Returns:
The parent node (RowSet) of this row.
Overrides:
getParentNode in class UnImplNode

hasChildNodes

public boolean hasChildNodes()
Tell if the row Node has any children (col Nodes), which should always be true.
Returns:
True if the row has any children
Overrides:
hasChildNodes in class UnImplNode


Copyright © 2000 Apache XML Project. All Rights Reserved.