net.sf.farrago.fennel.tuple
Class FennelTupleResultSet

java.lang.Object
  extended by org.eigenbase.jdbc4.Unwrappable
      extended by org.eigenbase.util14.AbstractResultSet
          extended by net.sf.farrago.fennel.tuple.FennelTupleResultSet
All Implemented Interfaces:
ResultSet

public abstract class FennelTupleResultSet
extends AbstractResultSet

FennelTupleResultSet provides an abstract java.sql.ResultSet based on tuples. This object uses the Java Tuple Library to interpret tuple data as presented in fennel tuple format and presents java objects and/or primitives as requested by the application. TODO: FennelTupleResultSet minimizes object creation while remapping tuple data to java objects in order to provide higher performance. This class is JDK 1.4 compatible.

Since:
Jan 8, 2006
Version:
$Id: //open/dev/farrago/src/net/sf/farrago/fennel/tuple/FennelTupleResultSet.java#17 $
Author:
angel

Field Summary
protected  FennelTupleAccessor accessor
           
protected  FennelTupleData data
           
private static TimeZone defaultZone
          The default timezone for this Java VM.
protected  FennelTupleDescriptor desc
           
static String ERRMSG_NO_TUPLE
           
protected  ResultSetMetaData metaData
           
protected  int tupleAlignment
           
protected  int tupleAlignmentMask
           
protected  boolean tupleComputed
           
 
Fields inherited from class org.eigenbase.util14.AbstractResultSet
fetchSize, maxRows, wasNull
 
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
 
Constructor Summary
FennelTupleResultSet(FennelTupleDescriptor desc, ResultSetMetaData metaData)
           
FennelTupleResultSet(FennelTupleDescriptor desc, ResultSetMetaData metaData, int tupleAlignment)
           
 
Method Summary
protected  void alignBufferPosition(ByteBuffer buf)
          Adjusts ByteBuffer position according to the tuple alignment mask.
protected  boolean computeTuple()
          compute the tuple accessors
 ResultSetMetaData getMetaData()
          The number, types and properties of a ResultSet's columns are provided by the getMetaData method.
protected static long getMillis(FennelTupleDatum d)
           
protected static long getMillis(FennelTupleDatum d, boolean shiftForTimeZone)
           
protected  Object getRaw(int columnIndex)
          Returns the raw object representing this column
static Object getRawColumnData(int columnIndex, ResultSetMetaData metaData, FennelTupleData tupleData)
           
 
Methods inherited from class org.eigenbase.util14.AbstractResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getRaw, getRef, getRef, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, newConversionError, newConversionError, newDirectionError, newFetchError, newUpdatabilityError, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, setMaxRows, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.ResultSet
next
 

Field Detail

ERRMSG_NO_TUPLE

public static final String ERRMSG_NO_TUPLE
See Also:
Constant Field Values

defaultZone

private static final TimeZone defaultZone
The default timezone for this Java VM.


metaData

protected ResultSetMetaData metaData

desc

protected FennelTupleDescriptor desc

accessor

protected FennelTupleAccessor accessor

data

protected FennelTupleData data

tupleComputed

protected boolean tupleComputed

tupleAlignment

protected final int tupleAlignment

tupleAlignmentMask

protected final int tupleAlignmentMask
Constructor Detail

FennelTupleResultSet

public FennelTupleResultSet(FennelTupleDescriptor desc,
                            ResultSetMetaData metaData,
                            int tupleAlignment)

FennelTupleResultSet

public FennelTupleResultSet(FennelTupleDescriptor desc,
                            ResultSetMetaData metaData)
Method Detail

computeTuple

protected boolean computeTuple()
compute the tuple accessors


alignBufferPosition

protected void alignBufferPosition(ByteBuffer buf)
Adjusts ByteBuffer position according to the tuple alignment mask. Used when "slicing" tuples from a multiple-tuple buffer.

Parameters:
buf -

getMillis

protected static long getMillis(FennelTupleDatum d,
                                boolean shiftForTimeZone)

getMillis

protected static long getMillis(FennelTupleDatum d)

getRaw

protected Object getRaw(int columnIndex)
                 throws SQLException
Returns the raw object representing this column

Specified by:
getRaw in class AbstractResultSet
Parameters:
columnIndex - column ordinal
Returns:
raw object for a column
Throws:
SQLException

getRawColumnData

public static Object getRawColumnData(int columnIndex,
                                      ResultSetMetaData metaData,
                                      FennelTupleData tupleData)
                               throws SQLException
Parameters:
columnIndex - column ordinal
metaData - metadata for all columns
tupleData - tuple data representing a row of columns
Returns:
column data corresponding to a specified column ordinal; null if the data is null
Throws:
SQLException

getMetaData

public ResultSetMetaData getMetaData()
                              throws SQLException
The number, types and properties of a ResultSet's columns are provided by the getMetaData method.

Returns:
the description of a ResultSet's columns
Throws:
SQLException