com.northgateis.reality.realsql
Class RealRowTokenizer

java.lang.Object
 |
 +--com.northgateis.reality.realsql.RealRowTokenizer

public class RealRowTokenizer
extends java.lang.Object
implements RealRowParser

Container for all column data in a single row returned from the Reality SQL Server.

The row is parsed to extract column data, any data truncation errors are flagged and will be made available after a ResultSet.getXXX() operation. To speed processing the parsing is accomplished in a separate thread.


Constructor Summary
RealRowTokenizer(RealItemTokenizer data, int logLevel)
           
RealRowTokenizer(RealSQLResultSetMetaData metadata, RealItemTokenizer data, int traceFlags)
           
 
Method Summary
 java.util.Iteratorcolumns()
          Returns an iterator for this row.
 booleanexists(int index)
          Check if column index is valid for this row.
 java.lang.StringgetValue(int index)
          Get the value for a specified column index.
protected  java.sql.SQLWarninggetWarning(int index)
          Get non-fatal warning messages found during parsing, including data truncation errors.
 intsize()
          Get the number of columns in this row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealRowTokenizer

public RealRowTokenizer(RealItemTokenizer data,
 int logLevel)

RealRowTokenizer

public RealRowTokenizer(RealSQLResultSetMetaData metadata,
                        RealItemTokenizer data,
 int traceFlags)
Method Detail

columns

public java.util.Iterator columns()
 throws RealSQLException
Returns an iterator for this row.

Specified by:
columns in interface RealRowParser
Returns:
RealColumnIterator.


getValue

public java.lang.String getValue(int index)
 throws RealSQLException
Get the value for a specified column index.

Specified by:
getValue in interface RealRowParser
Parameters:
index - column index to retrieve.
Returns:
column value as a String.
Throws:
RealSQLException - if index exceeds number of columns in row or an error occurs during parsing.


exists

public boolean exists(int index)
 throws RealSQLException
Check if column index is valid for this row.

Specified by:
exists in interface RealRowParser
Parameters:
index - column index to check.
Returns:
true if column index exists; else false.
Throws:
RealSQLException - if index exceeds number of columns in row or an error occurs during parsing.


size

public int size()
 throws RealSQLException
Get the number of columns in this row.

Specified by:
size in interface RealRowParser
Returns:
number of columns.
Throws:
RealSQLException - if index exceeds number of columns in row or an error occurs during parsing.


getWarning

protected java.sql.SQLWarning getWarning(int index)
 throws RealSQLException
Get non-fatal warning messages found during parsing, including data truncation errors.

Parameters:
index - column index to return any non-fatal warning messages.
Returns:
first SQLWarning, other warning exceptions maybe chained off the first.
Throws:
RealSQLException - if index exceeds number of columns in row.