Download Stylus Studio - The World's Best XML Development Environment!


com.ddtek.jdbc.jxtr
Class XMLType

java.lang.Object
  |
  +--com.ddtek.jdbc.jxtr.XMLType

public class XMLType
extends java.lang.Object

The XMLType object represents an XML value that is retrieved from a JDBC ResultSet using the getObject method.

It provides methods to instantiate the XML in different formats.

It is important to realize that all these methods, except generateSAX and writeXML, require complete instantiation of the XML value. Depending on the size of the XML value this can cause performance or scalability problems.


Constructor Summary
XMLType(JXTRDriverConfig jxtrDriverConfig, JXTRColInfo col)
          Internal constructor.
 
Method Summary
 void generateSAX(org.xml.sax.XMLReader xmlReader)
          Generates a SAX2 event stream corresponding to the retrieved XML value.
 java.sql.Clob getClob()
          Returns the retrieved XML value as a CLOB object.
 org.w3c.dom.Document getDOM()
          Returns the retrieved XML value as a DOM document.
 void getDOM(org.w3c.dom.Node node)
          Returns the retrieved XML value as a child DOM node of the specified DOM node.
 org.jdom.Document getJDOM()
          Returns the retrieved XML value as a JDOM document.
 void getJDOM(org.jdom.Element jdomElement)
          Returns the retrieved XML value as a child JDOM node of the specified JDOM node.
 java.lang.String getString()
          Returns the XML value as a String.
 void writeXML(java.io.Writer writer, java.lang.String encoding)
          Writes the retrieved XML value out to a Writer object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLType

public XMLType(JXTRDriverConfig jxtrDriverConfig,
               JXTRColInfo col)
Internal constructor.

Method Detail

getString

public java.lang.String getString()
                           throws java.sql.SQLException
Returns the XML value as a String.

Returns:
Retrieved XML value as a String
Throws:
java.sql.SQLException - If a database error occurs

writeXML

public void writeXML(java.io.Writer writer,
                     java.lang.String encoding)
              throws java.sql.SQLException
Writes the retrieved XML value out to a Writer object.

Parameters:
writer - Writer object in which the XML value is written.
encoding - Character encoding the Writer is using
Throws:
java.sql.SQLException - If a database error occurs

generateSAX

public void generateSAX(org.xml.sax.XMLReader xmlReader)
                 throws java.sql.SQLException
Generates a SAX2 event stream corresponding to the retrieved XML value.

Parameters:
xmlReader - SAX2 event handler
Throws:
java.sql.SQLException - If a database error occurs

getDOM

public org.w3c.dom.Document getDOM()
                            throws java.sql.SQLException
Returns the retrieved XML value as a DOM document.

Returns:
The XML value as a DOM document.
Throws:
java.sql.SQLException - If a database error occurs.

getDOM

public void getDOM(org.w3c.dom.Node node)
            throws java.sql.SQLException
Returns the retrieved XML value as a child DOM node of the specified DOM node.

Parameters:
node - DOM node under which the XML value will be created.
Throws:
java.sql.SQLException - If a database error occurs.

getJDOM

public org.jdom.Document getJDOM()
                          throws java.sql.SQLException
Returns the retrieved XML value as a JDOM document.

Returns:
The XML value as a JDOM document.
Throws:
java.sql.SQLException - If a database error occurs.

getJDOM

public void getJDOM(org.jdom.Element jdomElement)
             throws java.sql.SQLException
Returns the retrieved XML value as a child JDOM node of the specified JDOM node.

Parameters:
jdomElement - JDOM node under which the XML value will be created.
Throws:
java.sql.SQLException - If a database error occurs.

getClob

public java.sql.Clob getClob()
                      throws java.sql.SQLException
Returns the retrieved XML value as a CLOB object. Unlike the traditional JDBC Clob objects that typically are retrieved from the RDBMS on application demand, the Connect for SQL/XML Clob object is completely instantiated and cached on the local machine. Depending on the size of the Clob, part of this cache is backed up by disk storage. This can result in a performance penalty when retrieving large XML results as Clob objects.

Returns:
The XML value as a CLOB object.
Throws:
java.sql.SQLException - If a database error occurs.


Stylus Studio features SQL/XML tools for building XML views of relational data.