Stellent
HowToComponents
JavaDoc

intradoc.data
Interface ResultSet

All Known Implementing Classes:
AliasingResultSet, DataResultSet

public interface ResultSet

The interface ResultSet creates a generic mechanism for managing database tables.


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.
 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.
 

Method Detail

isMutable

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


hasRawObjects

public boolean hasRawObjects()
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.


getNumFields

public int getNumFields()
Returns number of fields.

Returns:
Number of fields in result set.

isEmpty

public boolean isEmpty()
Checks to see if result set is empty.

Returns:
True if result set has no rows.

isRowPresent

public boolean isRowPresent()
Checks to see if we have gone past last valid record.

Returns:
True if on a row with data in it.

getFieldName

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

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)
Gets field information for a particular named field. Returns false if no field information was present.

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)
Gets field information for a field at particular field index.

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)
Gets the value for a current field as a string for the currently loaded result set row.

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)
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.

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)
Sets the IdcDateFormat object for this ResultSet. String representations of dates should be in this format.


getDateFormat

public IdcDateFormat getDateFormat()
Gets the IdcDateFormat object for this ResultSet.


next

public boolean next()
Advances to the next row. Returns false if there is no next row.

Returns:
True if there was a next row after this one, false otherwise.

first

public boolean first()
Sets the result set to the first row.

Returns:
Returns false if the result set is empty.

skip

public int skip(int numRows)
Skip number of rows.

Returns:
Returns number of row skipped.

closeInternals

public 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. 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.



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