org.vrspace.server.db
Class Result

java.lang.Object
  extended byorg.vrspace.server.db.Result

public class Result
extends java.lang.Object

storage class that holds result of a select query

Author:
eddie@vrspace.org

Field Summary
 java.lang.String[] columnNames
          names of columns
 int[] columnTypes
          SQL types of columns
 int currentRow
          current row in the values matrix
 int noCols
          number of columns in the values matrix
 int noRows
          number of rows in the values matrix
 java.lang.Object[][] values
          values returned by DBUtil.select
 
Constructor Summary
Result(int noRows, int noCols)
          constructor initialises result object
 
Method Summary
 byte getByte(int col)
          returns value from current row as byte
 byte getByte(java.lang.String colName)
          returns value from current row as byte
 java.lang.Byte getByteObject(int col)
          returns value from current row as Byte
 java.lang.Byte getByteObject(java.lang.String colName)
          returns value from current row as Byte
 java.lang.String getColumnName(int col)
          returns the name of a specified column index
 int getColumnType(int col)
          returns the SQL type of a specified column index
 double getDouble(int col)
          returns value from current row as double
 double getDouble(java.lang.String colName)
          returns value from current row as Double
 java.lang.Double getDoubleObject(int col)
          returns value from current row as Double
 java.lang.Double getDoubleObject(java.lang.String colName)
          returns value from current row as Double
 float getFloat(int col)
          returns value from current row as float
 float getFloat(java.lang.String colName)
          returns value from current row as float
 java.lang.Float getFloatObject(int col)
          returns value from current row as Float
 java.lang.Float getFloatObject(java.lang.String colName)
          returns value from current row as Float
 int getInt(int col)
          returns value from current row as int
 int getInt(java.lang.String colName)
          returns value from current row as int
 java.lang.Integer getIntObject(int col)
          returns value from current row as Integer
 java.lang.Integer getIntObject(java.lang.String colName)
          returns value from current row as Integer
 long getLong(int col)
          returns value from current row as long
 long getLong(java.lang.String colName)
          returns value from current row as long
 java.lang.Long getLongObject(int col)
          returns value from current row as Long
 java.lang.Long getLongObject(java.lang.String colName)
          returns value from current row as Long
 short getShort(int col)
          returns value from current row as short
 short getShort(java.lang.String colName)
          returns value from current row as short
 java.lang.Short getShortObject(int col)
          returns value from current row as Short
 java.lang.Short getShortObject(java.lang.String colName)
          returns value from current row as Short
 java.lang.String getString(int col)
          returns value from current row as string
 java.lang.String getString(java.lang.String colName)
          returns value from current row as string
 boolean next()
          increases current row index by 1
 void reset()
          resets the current row index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noRows

public int noRows
number of rows in the values matrix


noCols

public int noCols
number of columns in the values matrix


values

public java.lang.Object[][] values
values returned by DBUtil.select


columnNames

public java.lang.String[] columnNames
names of columns


columnTypes

public int[] columnTypes
SQL types of columns


currentRow

public int currentRow
current row in the values matrix

Constructor Detail

Result

public Result(int noRows,
              int noCols)
constructor initialises result object

Method Detail

getString

public java.lang.String getString(int col)
returns value from current row as string

Returns:
String value

getString

public java.lang.String getString(java.lang.String colName)
returns value from current row as string

Returns:
String value

getByte

public byte getByte(int col)
returns value from current row as byte

Returns:
byte value

getByteObject

public java.lang.Byte getByteObject(int col)
returns value from current row as Byte

Returns:
byte value

getByte

public byte getByte(java.lang.String colName)
returns value from current row as byte

Returns:
byte value

getByteObject

public java.lang.Byte getByteObject(java.lang.String colName)
returns value from current row as Byte

Returns:
byte value

getShort

public short getShort(int col)
returns value from current row as short

Returns:
short value

getShortObject

public java.lang.Short getShortObject(int col)
returns value from current row as Short

Returns:
short value

getShort

public short getShort(java.lang.String colName)
returns value from current row as short

Returns:
short value

getShortObject

public java.lang.Short getShortObject(java.lang.String colName)
returns value from current row as Short

Returns:
short value

getInt

public int getInt(int col)
returns value from current row as int

Returns:
int value

getIntObject

public java.lang.Integer getIntObject(int col)
returns value from current row as Integer

Returns:
int value

getInt

public int getInt(java.lang.String colName)
returns value from current row as int

Returns:
int value

getIntObject

public java.lang.Integer getIntObject(java.lang.String colName)
returns value from current row as Integer

Returns:
int value

getLong

public long getLong(int col)
returns value from current row as long

Returns:
long value

getLongObject

public java.lang.Long getLongObject(int col)
returns value from current row as Long

Returns:
long value

getLong

public long getLong(java.lang.String colName)
returns value from current row as long

Returns:
long value

getLongObject

public java.lang.Long getLongObject(java.lang.String colName)
returns value from current row as Long

Returns:
long value

getFloat

public float getFloat(int col)
returns value from current row as float

Returns:
float value

getFloatObject

public java.lang.Float getFloatObject(int col)
returns value from current row as Float

Returns:
float value

getFloat

public float getFloat(java.lang.String colName)
returns value from current row as float

Returns:
float value

getFloatObject

public java.lang.Float getFloatObject(java.lang.String colName)
returns value from current row as Float

Returns:
float value

getDouble

public double getDouble(int col)
returns value from current row as double

Returns:
double value

getDoubleObject

public java.lang.Double getDoubleObject(int col)
returns value from current row as Double

Returns:
double value

getDouble

public double getDouble(java.lang.String colName)
returns value from current row as Double

Returns:
double value

getDoubleObject

public java.lang.Double getDoubleObject(java.lang.String colName)
returns value from current row as Double

Returns:
double value

getColumnName

public java.lang.String getColumnName(int col)
returns the name of a specified column index

Returns:
String column name

getColumnType

public int getColumnType(int col)
returns the SQL type of a specified column index

Returns:
int SQL column type

next

public boolean next()
increases current row index by 1

Returns:
boolean false if no more rows available

reset

public void reset()
resets the current row index