BDBXMLResultSetBDBXMLResultSet
Holds a Berkeley BDBXML XmlResults
Home > Books > NetKernel API and Services Reference > Aspect Listing > XML Aspects > BDBXMLResultSet

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Module

urn:org:ten60:netkernel:mod:dbxml

Class

org.ten60.dbxml.representation.DBXMLResultAspect

Purpose

Holds a com.sleepycat.dbxml.XmlResults.

This aspect is useful for scripting languages to iterate over a result set. This aspect must be treated as immutable. Once its values have been read it is strongly adviced that the delete() method is called on the XmlResults object - this will clean up any native resources held in the underlying native DBXML database.


public class DBXMLResultAspect implements IURAspect
{
    private XmlResults mResults;

    public DBXMLResultAspect(XmlResults aResults)
    {   mResults=aResults;
    }
    
    public XmlResults getXmlResultsReadOnly()
    {   return mResults;
    }
    
    public boolean isEmpty() throws Exception
    {   return mResults.size()==0;      
    }
    
    public boolean hasXmlDocument() throws Exception
    {   if (mResults.size()!=1) return false;
        XmlValue val=mResults.peek();
        try
        {   val.asDocument();
            return true;
        }
        catch(Exception e)
        {   return false;           
        }
    }
}

© 2003-2007, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.