org.bibop.xml.xforge.components.sql
Class ResultSetToSax

java.lang.Object
  |
  +--org.bibop.xml.xforge.components.sql.ResultSetToSax

public class ResultSetToSax
extends java.lang.Object

A utility class to convert a SQL ResultSet to SAX events.

Version:
1.0
Author:
Alberto Garoffolo

Nested Class Summary
(package private)  class ResultSetToSax.InternalContentHandler
           
 
Field Summary
protected  org.xml.sax.ContentHandler contentHandler
           
static java.lang.String DEFAULT_ENCODING
           
protected  java.lang.String encoding
           
(package private)  char[] newline
           
protected  org.xml.sax.XMLReader parser
           
 
Constructor Summary
ResultSetToSax()
           
ResultSetToSax(java.lang.String enc)
           
 
Method Summary
protected  java.io.InputStream LOBtoInputStream(java.sql.ResultSet rs, int i, java.lang.String driver, int type)
           
protected  void objectToSax(java.lang.String tagName, int type, java.sql.ResultSet rs, int i, java.lang.String driver)
          utility to print a method result
 void parse(java.sql.ResultSet rs)
           
 void setContentHandler(org.xml.sax.ContentHandler cHandler)
          Set the ContentHandler that will receive XML data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected org.xml.sax.XMLReader parser

newline

char[] newline

encoding

protected java.lang.String encoding

DEFAULT_ENCODING

public static java.lang.String DEFAULT_ENCODING

contentHandler

protected org.xml.sax.ContentHandler contentHandler
Constructor Detail

ResultSetToSax

public ResultSetToSax(java.lang.String enc)
               throws org.xml.sax.SAXException

ResultSetToSax

public ResultSetToSax()
               throws org.xml.sax.SAXException
Method Detail

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler cHandler)
Set the ContentHandler that will receive XML data.


parse

public void parse(java.sql.ResultSet rs)
           throws org.xml.sax.SAXException
org.xml.sax.SAXException

objectToSax

protected void objectToSax(java.lang.String tagName,
                           int type,
                           java.sql.ResultSet rs,
                           int i,
                           java.lang.String driver)
                    throws org.xml.sax.SAXException,
                           java.sql.SQLException
utility to print a method result

Throws:
XForgeException
org.xml.sax.SAXException
java.sql.SQLException

LOBtoInputStream

protected java.io.InputStream LOBtoInputStream(java.sql.ResultSet rs,
                                               int i,
                                               java.lang.String driver,
                                               int type)
                                        throws java.sql.SQLException
java.sql.SQLException


Copyright © 2003 Bibop Research International. All Rights Reserved.