com.sybase.persistence
Class QueryResultSet

java.lang.Object
  extended by java.util.Vector
      extended by com.sybase.collections.ObjectList
          extended by com.sybase.persistence.QueryResultSet

public class QueryResultSet
extends ObjectList

A QueryResultSet object represents the result set from a dynamic query. This type of object is returned by a package's database class method executeQuery, and by MBO named query methods that return result sets instead of MBO lists. A QueryResultSet contains attributes representing the names and types of the columns selected in the query that produced the result set.


Field Summary
protected  StringList __columnNames
           
protected  ObjectList __columnTypes
           
protected  DataValue __columnValue
           
protected  ColumnIndexMap __nameToIndex
           
protected  int __rowIndex
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Constructor Summary
QueryResultSet()
          Initializes a new instance of the QueryResultSet class.
QueryResultSet(int capacity)
          Initializes a new instance of the QueryResultSet class with specified capacity.
 
Method Summary
 boolean absolute(int index)
          Moves to the specified row of the result set and returns true if succeed.
 int add(DataValueList x)
          Sybase internal use only.
 void afterLast()
          Moves the cursor to the end of this ResultSet object, just after the last row .
 void beforeFirst()
          Moves the cursor to the front of this ResultSet object, just before the first row.
 void checkIndex(int index)
          Sybase internal use only.
 int findColumn(java.lang.String name)
          Sybase internal use only.
 QueryResultSet finishInit()
          Sybase internal use only.
 boolean first()
          Moves the cursor to the first row in this ResultSet object.
 byte[] getBinary(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a byte array.
 byte[] getBinaryByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a byte array.
 boolean getBoolean(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a boolean.
 boolean getBooleanByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a boolean.
 byte getByte(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a byte.
 byte getByteByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a byte.
 char getChar(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a char.
 char getCharByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a char.
 int getColumnCount()
          Sybase internal use only.
 java.lang.String getColumnName(int index)
          Gets name of the specified column.
 StringList getColumnNames()
          Gets the names of the columns selected in the query.
 DataType getColumnType(int index)
          Gets type of the specified column.
 ObjectList getColumnTypes()
          Gets the types of the columns selected in the query.
 DataValue getDataValue(int index)
          Sybase internal use only.
 DataValue getDataValueByName(java.lang.String name)
          Sybase internal use only.
 java.util.Date getDate(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a Date object.
 java.util.Date getDateByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a Date object.
 java.util.Date getDateTime(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a Date object.
 java.util.Date getDateTimeByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a Date object.
 java.lang.String getDecimal(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a String object.
 java.lang.String getDecimalByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a String object.
 double getDouble(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a double.
 double getDoubleByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a doulbe.
 float getFloat(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a float.
 float getFloatByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a float.
 int getInt(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as an int.
 int getIntByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as an int.
 java.lang.String getInteger(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a String object.
 java.lang.String getIntegerByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a String object.
 long getLong(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a long.
 long getLongByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a long.
 int getRow()
          Sybase internal use only.
 int getRowCount()
          Gets the row count of the query result.
 short getShort(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a short.
 short getShortByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a short.
 java.lang.String getString(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a String object.
 java.lang.String getStringByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a String object.
 java.util.Date getTime(int index)
          Retrieves the value of the designated column in the current row of this ResultSet object as a Date object.
 java.util.Date getTimeByName(java.lang.String name)
          Retrieves the value of the designated column by column name in the current row of this ResultSet object as a Date object.
 boolean last()
          Moves the cursor to the last row in this ResultSet object..
 boolean next()
          Moves the cursor down one row from its current position.
 void populate(ianywhere.ultralitej.ResultSet rs)
           
 boolean previous()
          Moves the cursor to the previous row in this ResultSet object.
 boolean relative(int delta)
          Moves the cursor a relative number of rows, either positive or negative.
 void setColumnNames(StringList _columnNames)
          Sets the names of the columns selected in the query.
 void setColumnTypes(ObjectList _columnTypes)
          Sets the types of the columns selected in the query.
 boolean wasNull()
          Returns true if current column value is null.
 
Methods inherited from class com.sybase.collections.ObjectList
add, addThis, count, getByIndex, insert, item, remove, slice
 
Methods inherited from class java.util.Vector
addElement, capacity, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size, toString, trimToSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__columnNames

protected StringList __columnNames

__columnTypes

protected ObjectList __columnTypes

__nameToIndex

protected ColumnIndexMap __nameToIndex

__rowIndex

protected int __rowIndex

__columnValue

protected DataValue __columnValue
Constructor Detail

QueryResultSet

public QueryResultSet()
Initializes a new instance of the QueryResultSet class.


QueryResultSet

public QueryResultSet(int capacity)
Initializes a new instance of the QueryResultSet class with specified capacity.

Method Detail

getColumnNames

public StringList getColumnNames()
Gets the names of the columns selected in the query.


setColumnNames

public void setColumnNames(StringList _columnNames)
Sets the names of the columns selected in the query.


getColumnTypes

public ObjectList getColumnTypes()
Gets the types of the columns selected in the query.


setColumnTypes

public void setColumnTypes(ObjectList _columnTypes)
Sets the types of the columns selected in the query.


findColumn

public int findColumn(java.lang.String name)
Sybase internal use only.


getColumnCount

public int getColumnCount()
Sybase internal use only.


getColumnName

public java.lang.String getColumnName(int index)
Gets name of the specified column.


getColumnType

public DataType getColumnType(int index)
Gets type of the specified column.


getRowCount

public int getRowCount()
Gets the row count of the query result.


getRow

public int getRow()
Sybase internal use only.


absolute

public boolean absolute(int index)
Moves to the specified row of the result set and returns true if succeed.

Returns:
True if the cursor is on a row; false otherwise

relative

public boolean relative(int delta)
Moves the cursor a relative number of rows, either positive or negative.

Returns:
True if the cursor is on a row; false otherwise

next

public boolean next()
Moves the cursor down one row from its current position.

Returns:
true if the new current row is valid; false if there are no more rows

previous

public boolean previous()
Moves the cursor to the previous row in this ResultSet object.

Returns:
true if the cursor is on a valid row; false if it is off the result set

beforeFirst

public void beforeFirst()
Moves the cursor to the front of this ResultSet object, just before the first row.


afterLast

public void afterLast()
Moves the cursor to the end of this ResultSet object, just after the last row .


first

public boolean first()
Moves the cursor to the first row in this ResultSet object.


last

public boolean last()
Moves the cursor to the last row in this ResultSet object..


getBoolean

public boolean getBoolean(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a boolean.


getString

public java.lang.String getString(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a String object.


getBinary

public byte[] getBinary(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a byte array.


getChar

public char getChar(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a char.


getByte

public byte getByte(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a byte.


getShort

public short getShort(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a short.


getInt

public int getInt(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as an int.


getLong

public long getLong(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a long.


getInteger

public java.lang.String getInteger(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a String object.


getDecimal

public java.lang.String getDecimal(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a String object.


getFloat

public float getFloat(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a float.


getDouble

public double getDouble(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a double.


getDate

public java.util.Date getDate(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a Date object.


getTime

public java.util.Date getTime(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a Date object.


getDateTime

public java.util.Date getDateTime(int index)
Retrieves the value of the designated column in the current row of this ResultSet object as a Date object.


getDataValue

public DataValue getDataValue(int index)
Sybase internal use only.


getBooleanByName

public boolean getBooleanByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a boolean.

Parameters:
name - Column name

getStringByName

public java.lang.String getStringByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a String object.

Parameters:
name - Column name

getBinaryByName

public byte[] getBinaryByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a byte array.

Parameters:
name - Column name

getCharByName

public char getCharByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a char.

Parameters:
name - Column name

getByteByName

public byte getByteByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a byte.

Parameters:
name - Column name

getShortByName

public short getShortByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a short.

Parameters:
name - Column name

getIntByName

public int getIntByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as an int.

Parameters:
name - Column name

getLongByName

public long getLongByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a long.

Parameters:
name - Column name

getIntegerByName

public java.lang.String getIntegerByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a String object.

Parameters:
name - Column name

getDecimalByName

public java.lang.String getDecimalByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a String object.

Parameters:
name - Column name

getFloatByName

public float getFloatByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a float.

Parameters:
name - Column name

getDoubleByName

public double getDoubleByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a doulbe.

Parameters:
name - Column name

getDateByName

public java.util.Date getDateByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a Date object.

Parameters:
name - Column name

getTimeByName

public java.util.Date getTimeByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a Date object.

Parameters:
name - Column name

getDateTimeByName

public java.util.Date getDateTimeByName(java.lang.String name)
Retrieves the value of the designated column by column name in the current row of this ResultSet object as a Date object.

Parameters:
name - Column name

getDataValueByName

public DataValue getDataValueByName(java.lang.String name)
Sybase internal use only.


wasNull

public boolean wasNull()
Returns true if current column value is null.


checkIndex

public void checkIndex(int index)
Sybase internal use only.


finishInit

public QueryResultSet finishInit()
Sybase internal use only.


add

public int add(DataValueList x)
Sybase internal use only.


populate

public void populate(ianywhere.ultralitej.ResultSet rs)
              throws ianywhere.ultralitej.ULjException
Throws:
ianywhere.ultralitej.ULjException