uk.org.ogsadai.common
Class ResultSetToWebRowSetXMLStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--uk.org.ogsadai.common.ResultSetToWebRowSetXMLStream
All Implemented Interfaces:
BlockReader

public class ResultSetToWebRowSetXMLStream
extends java.io.InputStream
implements BlockReader

Generates a WebRowSet XML representation of the results of an SQL query held in a java.sql.ResultSet object.

The following types are currently unsupported:

The following types are supported but have not been thoroughly tested:

Author:
The OGSA-DAI Project Team

Field Summary
static java.lang.String EMPTY_BLOB_DATA_TAG
           
static java.lang.String EMPTY_STRING_DATA_TAG
           
static java.lang.String NULL_DATA_TAG
           
 
Constructor Summary
ResultSetToWebRowSetXMLStream(java.sql.ResultSet rs)
          Method ResultSetToWebRowSetXMLStream.
ResultSetToWebRowSetXMLStream(java.sql.ResultSet rs, int noOfRowsToCache)
          Method ResultSetToWebRowSetXMLStream.
 
Method Summary
 CommonException getError()
          Returns a CommonException if there has been an error in the next() method, null otherwise.
 boolean hasNext()
          Indicates whether or not there are any more blocks of data to be read from the block reader.
 java.lang.Object next()
          Gets the next block of data contained in the block reader.
 int read()
           
 java.lang.String readBlock()
          Method readBlock.
 java.lang.String readBlocks(int count)
          Method readBlocks.
 java.lang.String readMetaData()
          Method readMetaData.
 java.lang.String readProperties()
          Method readProperties.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_DATA_TAG

public static final java.lang.String NULL_DATA_TAG
See Also:
Constant Field Values

EMPTY_STRING_DATA_TAG

public static final java.lang.String EMPTY_STRING_DATA_TAG
See Also:
Constant Field Values

EMPTY_BLOB_DATA_TAG

public static final java.lang.String EMPTY_BLOB_DATA_TAG
See Also:
Constant Field Values
Constructor Detail

ResultSetToWebRowSetXMLStream

public ResultSetToWebRowSetXMLStream(java.sql.ResultSet rs)
Method ResultSetToWebRowSetXMLStream.

Parameters:
rs -
Throws:
java.lang.IllegalArgumentException - if rs is null

ResultSetToWebRowSetXMLStream

public ResultSetToWebRowSetXMLStream(java.sql.ResultSet rs,
                                     int noOfRowsToCache)
Method ResultSetToWebRowSetXMLStream.

Parameters:
rs -
noOfRowsToCache -
Throws:
java.lang.IllegalArgumentException - if rs is null
Method Detail

readMetaData

public java.lang.String readMetaData()
Method readMetaData.

Returns:
String

readProperties

public java.lang.String readProperties()
Method readProperties.

Returns:
String

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
java.io.IOException

readBlock

public java.lang.String readBlock()
                           throws CommonException
Method readBlock.

Returns:
String
CommonException

readBlocks

public java.lang.String readBlocks(int count)
                            throws java.io.IOException,
                                   CommonException
Method readBlocks.

Parameters:
count -
Returns:
String
java.io.IOException
CommonException

next

public java.lang.Object next()
Description copied from interface: BlockReader
Gets the next block of data contained in the block reader.

Specified by:
next in interface BlockReader
Returns:
an Object

hasNext

public boolean hasNext()
Description copied from interface: BlockReader
Indicates whether or not there are any more blocks of data to be read from the block reader.

Specified by:
hasNext in interface BlockReader
Returns:
true if there are more blocks to be read or false otherwise

getError

public CommonException getError()
Returns a CommonException if there has been an error in the next() method, null otherwise.

Returns:
null if no error, or the CommonException if there is an error