Stellent
HowToComponents
JavaDoc

intradoc.data
Class AliasingResultSet

java.lang.Object
  |
  +--intradoc.data.AliasingResultSet
All Implemented Interfaces:
ResultSet

public class AliasingResultSet
extends java.lang.Object
implements ResultSet


Field Summary
protected  java.util.Hashtable m_forwardMap
           
protected  ResultSet m_resultSet
           
protected  java.util.Hashtable m_reverseMap
           
 
Constructor Summary
AliasingResultSet()
           
 
Method Summary
 void closeInternals()
          Because of bugs with implementations of result sets (specifically JDBC), we need to close one result set before creating a new one from the database.
 boolean first()
          Sets the result set to the first row.
 IdcDateFormat getDateFormat()
          Gets the IdcDateFormat object for this ResultSet.
 java.util.Date getDateValue(int index)
          Gets the field value as a date, only works for fields which are actually dates.
 boolean getFieldInfo(java.lang.String fieldName, FieldInfo fieldInfo)
          Gets field information for a particular named field.
 java.lang.String getFieldName(int index)
          Gets the name of field located at a particular field index (from 0 to getNumFields() - 1).
 void getIndexFieldInfo(int index, FieldInfo fieldInfo)
          Gets field information for a field at particular field index.
 int getNumFields()
          Returns number of fields.
 java.lang.String getStringValue(int index)
          Gets the value for a current field as a string for the currently loaded result set row.
 boolean hasRawObjects()
          Returns true if this ResultSet contains real objects, not String representations of the data.
 void init(ResultSet parentSet, java.util.Hashtable map)
           
 void init(ResultSet parentSet, java.lang.String mapString)
           
 boolean isEmpty()
          Checks to see if result set is empty.
 boolean isMutable()
          Returns true if it is legal for someone to mutate the contents of this ResultSet.
 boolean isRowPresent()
          Checks to see if we have gone past last valid record.
 boolean next()
          Advances to the next row.
 void setDateFormat(IdcDateFormat fmt)
          Sets the IdcDateFormat object for this ResultSet.
 int skip(int numRows)
          Skip number of rows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_resultSet

protected ResultSet m_resultSet

m_forwardMap

protected java.util.Hashtable m_forwardMap

m_reverseMap

protected java.util.Hashtable m_reverseMap
Constructor Detail

AliasingResultSet

public AliasingResultSet()
Method Detail

init

public void init(ResultSet parentSet,
                 java.lang.String mapString)

init

public void init(ResultSet parentSet,
                 java.util.Hashtable map)

isMutable

public boolean isMutable()
Description copied from interface: ResultSet
Returns true if it is legal for someone to mutate the contents of this ResultSet.

Specified by:
isMutable in interface ResultSet

hasRawObjects

public boolean hasRawObjects()
Description copied from interface: ResultSet
Returns true if this ResultSet contains real objects, not String representations of the data. If true, users of this object can directly change things like the date format and the ResultSet will magically change the String representations to match. If false, to change things like the date format the user MUST iterate through the ResultSet and reformat the date values to match the new format. Note that if isMutable() and hasRawObjects() both return false, you CANNOT change the localization of values in this ResultSet. Make a copy into a DataResultSet and change it there.

Specified by:
hasRawObjects in interface ResultSet

getNumFields

public int getNumFields()
Description copied from interface: ResultSet
Returns number of fields.

Specified by:
getNumFields in interface ResultSet
Returns:
Number of fields in result set.

isEmpty

public boolean isEmpty()
Description copied from interface: ResultSet
Checks to see if result set is empty.

Specified by:
isEmpty in interface ResultSet
Returns:
True if result set has no rows.

isRowPresent

public boolean isRowPresent()
Description copied from interface: ResultSet
Checks to see if we have gone past last valid record.

Specified by:
isRowPresent in interface ResultSet
Returns:
True if on a row with data in it.

getFieldName

public java.lang.String getFieldName(int index)
Description copied from interface: ResultSet
Gets the name of field located at a particular field index (from 0 to getNumFields() - 1).

Specified by:
getFieldName in interface ResultSet
Parameters:
index - Index into array of fields associated with this result set.
Returns:
Name of field at this index.

getFieldInfo

public boolean getFieldInfo(java.lang.String fieldName,
                            FieldInfo fieldInfo)
Description copied from interface: ResultSet
Gets field information for a particular named field. Returns false if no field information was present.

Specified by:
getFieldInfo in interface ResultSet
Parameters:
fieldName - Name of field being looked up.
fieldInfo - Holds information about the field after this method is called. Note: fieldInfo.m_index will hold the field index usable as a parameter to the calls 'getStringValue' and 'getDateValue'.
Returns:
True if field information was found, false otherwise.

getIndexFieldInfo

public void getIndexFieldInfo(int index,
                              FieldInfo fieldInfo)
Description copied from interface: ResultSet
Gets field information for a field at particular field index.

Specified by:
getIndexFieldInfo in interface ResultSet
Parameters:
index - Index into array of fields assocated with this result set.
fieldInfo - Holds information about the field after this method is called.

getStringValue

public java.lang.String getStringValue(int index)
Description copied from interface: ResultSet
Gets the value for a current field as a string for the currently loaded result set row.

Specified by:
getStringValue in interface ResultSet
Parameters:
index - Index into array of fields assocated with this result set.
Returns:
Value of field as a Unicode string.

getDateValue

public java.util.Date getDateValue(int index)
Description copied from interface: ResultSet
Gets the field value as a date, only works for fields which are actually dates. A date does not as easily convert from a string and back again as the other data types so a direct call to retrieving a date may be faster.

Specified by:
getDateValue in interface ResultSet
Parameters:
index - Index into array of fields assocated with this result set.
Returns:
Value of field as a Date object.

setDateFormat

public void setDateFormat(IdcDateFormat fmt)
Description copied from interface: ResultSet
Sets the IdcDateFormat object for this ResultSet. String representations of dates should be in this format.

Specified by:
setDateFormat in interface ResultSet

getDateFormat

public IdcDateFormat getDateFormat()
Description copied from interface: ResultSet
Gets the IdcDateFormat object for this ResultSet.

Specified by:
getDateFormat in interface ResultSet

next

public boolean next()
Description copied from interface: ResultSet
Advances to the next row. Returns false if there is no next row.

Specified by:
next in interface ResultSet
Returns:
True if there was a next row after this one, false otherwise.

first

public boolean first()
Description copied from interface: ResultSet
Sets the result set to the first row.

Specified by:
first in interface ResultSet
Returns:
Returns false if the result set is empty.

skip

public int skip(int numRows)
Description copied from interface: ResultSet
Skip number of rows.

Specified by:
skip in interface ResultSet
Returns:
Returns number of row skipped.

closeInternals

public void closeInternals()
Description copied from interface: ResultSet
Because of bugs with implementations of result sets (specifically JDBC), we need to close one result set before creating a new one from the database. This method insures that the result set has released all its allocated objects. Note: this rule applies on a thread by thread basis and the object implementing the Workspace object performs this activity automatically. This method should never be called directly.

Specified by:
closeInternals in interface ResultSet


(c) 1996-2005  All rights reserved.  Stellent, Inc.