uk.org.ogsadai.common
Class WebRowSetXMLStreamToResultSetScrollable
java.lang.Object
|
+--org.xml.sax.helpers.DefaultHandler
|
+--uk.org.ogsadai.common.WebRowSetXMLStreamToResultSet
|
+--uk.org.ogsadai.common.WebRowSetXMLStreamToResultSetScrollable
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, java.sql.ResultSet
- public class WebRowSetXMLStreamToResultSetScrollable
- extends WebRowSetXMLStreamToResultSet
This is a "Scrollable" implementation of the
WebRowSetXMLStreamToResultSet adapter class. Thus, the previous(),
next(), beforeFirst(), afterLast(),
first() and last() methods are all supported.
It is important to note that this implementation is unable to
handle large WebRowSet XML documents. This is because it attempts
to hold the entire result set in memory. Hence, this class should
be used with extreme caution when available memory space is
limited or large result sets are expected. Running out of memory
will cause an unrecoverable and fatal OutOfMemoryError.
- Author:
- The OGSA-DAI Project Team
| Fields inherited from class uk.org.ogsadai.common.WebRowSetXMLStreamToResultSet |
BASE_STATE, COL, COL_OLD, COL_STATE, COLCOUNT, COLCOUNT_STATE, COLDEFN, COLDEFN_STATE, DATA, DATA_STATE, EMPTY_BLOB, EMPTY_STRING, mCharDataBuffer, mColumnCount, mCommencedParsing, mCurrentColumn, mCurrentElement, mCurrentRow, mCursor, mDataInput, METADATA, METADATA_STATE, mLastColumnRead, mMetaData, mParser, mState, NULL, NULL_STATE, PROPERTIES, PROPERTIES_STATE, ROW, ROW_OLD, ROW_STATE, ROWSET, ROWSET_OLD, ROWSET_STATE |
| Fields inherited from interface java.sql.ResultSet |
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE |
| Methods inherited from class uk.org.ogsadai.common.WebRowSetXMLStreamToResultSet |
cancelRowUpdates, clearWarnings, close, create, deleteRow, findColumn, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getColumnStringNumeric, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getInt, getInt, getLong, getLong, getMetaData, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getShort, getShort, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, moveToCurrentRow, moveToInsertRow, refreshRow, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, terminate, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebRowSetXMLStreamToResultSetScrollable
public WebRowSetXMLStreamToResultSetScrollable(BlockReader reader)
- Constructor which initialises but does not commence parsing.
When using this constructor, you need to call the
parse()
method in order to commence parsing of the WebRowSet XML data.
- Parameters:
reader - the WebRowSet XML data stream
WebRowSetXMLStreamToResultSetScrollable
public WebRowSetXMLStreamToResultSetScrollable(BlockReader reader,
boolean parseNow)
throws org.xml.sax.SAXException,
java.io.IOException
- Constructor with an option to start parsing now. This constructor
calls the
parse() method after initialisation
iff parseNow is true.
- Parameters:
reader - the WebRowSet XML data streamparseNow - true iff the parse() should be invoked after initialisation
- Throws:
org.xml.sax.SAXException - if parseNow is true and if there is a problem whilst parsing the XML data
java.io.IOException - if parseNow is true and any IO error occurs
parse
public void parse()
throws org.xml.sax.SAXException,
java.io.IOException
- Method parse.
- Overrides:
parse in class WebRowSetXMLStreamToResultSet
- Throws:
java.io.IOException - if any IO error occurs
org.xml.sax.SAXException - if there is a problem whilst parsing the XML data
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attr)
- Specified by:
startElement in interface org.xml.sax.ContentHandler- Specified by:
startElement in class WebRowSetXMLStreamToResultSet
- See Also:
ContentHandler.startElement(String, String, String, Attributes)
endElement
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
- Description copied from class:
WebRowSetXMLStreamToResultSet
- Note that this method is called from within the parser thread.
- Specified by:
endElement in interface org.xml.sax.ContentHandler- Specified by:
endElement in class WebRowSetXMLStreamToResultSet
- See Also:
ContentHandler.endElement(String, String, String)
characters
public void characters(char[] ch,
int start,
int length)
- Specified by:
characters in interface org.xml.sax.ContentHandler- Specified by:
characters in class WebRowSetXMLStreamToResultSet
- See Also:
ContentHandler.characters(char[], int, int)
getColumnString
protected java.lang.String getColumnString(int columnIndex)
throws java.sql.SQLException
- Specified by:
getColumnString in class WebRowSetXMLStreamToResultSet
java.sql.SQLException
getType
public int getType()
throws java.sql.SQLException
- Specified by:
getType in interface java.sql.ResultSet- Specified by:
getType in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.getType()
next
public boolean next()
throws java.sql.SQLException
- Specified by:
next in interface java.sql.ResultSet- Specified by:
next in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.next()
previous
public boolean previous()
throws java.sql.SQLException
- Specified by:
previous in interface java.sql.ResultSet- Specified by:
previous in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.previous()
absolute
public boolean absolute(int row)
throws java.sql.SQLException
- Specified by:
absolute in interface java.sql.ResultSet- Specified by:
absolute in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.absolute(int)
relative
public boolean relative(int row)
throws java.sql.SQLException
- Specified by:
relative in interface java.sql.ResultSet- Specified by:
relative in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.relative(int)
isBeforeFirst
public boolean isBeforeFirst()
throws java.sql.SQLException
- Specified by:
isBeforeFirst in interface java.sql.ResultSet- Specified by:
isBeforeFirst in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.isBeforeFirst()
isAfterLast
public boolean isAfterLast()
throws java.sql.SQLException
- Specified by:
isAfterLast in interface java.sql.ResultSet- Specified by:
isAfterLast in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.isAfterLast()
isFirst
public boolean isFirst()
throws java.sql.SQLException
- Specified by:
isFirst in interface java.sql.ResultSet- Specified by:
isFirst in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.isFirst()
isLast
public boolean isLast()
throws java.sql.SQLException
- Specified by:
isLast in interface java.sql.ResultSet- Specified by:
isLast in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.isLast()
beforeFirst
public void beforeFirst()
throws java.sql.SQLException
- Specified by:
beforeFirst in interface java.sql.ResultSet- Specified by:
beforeFirst in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.beforeFirst()
afterLast
public void afterLast()
throws java.sql.SQLException
- Specified by:
afterLast in interface java.sql.ResultSet- Specified by:
afterLast in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.afterLast()
first
public boolean first()
throws java.sql.SQLException
- Specified by:
first in interface java.sql.ResultSet- Specified by:
first in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.first()
last
public boolean last()
throws java.sql.SQLException
- Specified by:
last in interface java.sql.ResultSet- Specified by:
last in class WebRowSetXMLStreamToResultSet
java.sql.SQLException- See Also:
ResultSet.last()