vortex.sql
Class vortexResultSet

java.lang.Object
  |
  +--vortex.sql.vortexResultSet

public class vortexResultSet
extends java.lang.Object
implements java.sql.ResultSet

This class implements the ResultSet for JDBC interface The class is designed to hold the results of database queries.

See Also:
ResultSet

Constructor Summary
vortexResultSet(vortexRecord red)
          Constructs a new result set object
 
Method Summary
 void clearWarnings()
          Clear the warning chain.
 void close()
          Close a result set.
 int findColumn(java.lang.String name)
          Given a column name, this method returns the column index for that name.
 java.io.InputStream getAsciiStream(int column)
          Get the value of a column in the current row as a Java AsciiStream.
 java.io.InputStream getAsciiStream(java.lang.String name)
          Very large ascii values in a LONGVARCHAR column can be read in small chunks from a java.io.InputStream.
 java.math.BigDecimal getBigDecimal(int column, int scale)
          Get the value of a column in the current row as a Java BigDecimal.
 java.math.BigDecimal getBigDecimal(java.lang.String name, int scale)
          Retrieve the column value as a numeric based on column name
 java.io.InputStream getBinaryStream(int column)
          Get the value of a column in the current row as a Java BinaryStream.
 java.io.InputStream getBinaryStream(java.lang.String name)
          Very large binary values in a LONGVARBINARY column can be read in small chunks from a java.io.InputStream.
 boolean getBoolean(int column)
          Get the value of a column in the current row as a Java boolean.
 boolean getBoolean(java.lang.String name)
          Retrieve the column value as a boolean based on column name
 byte getByte(int column)
          Get the value of a column in the current row as a Java byte.
 byte getByte(java.lang.String name)
          Get the value of a column in the current row as a Java byte.
 byte[] getBytes(int column)
          Get the value of a column in the current row as a Java byte array.
 byte[] getBytes(java.lang.String name)
          Retrieve the column value as a byte array based on column name
 java.lang.String getCursorName()
          Return a cursor name
 java.sql.Date getDate(int column)
          Get the value of a column in the current row as a Java date.
 java.sql.Date getDate(java.lang.String name)
          Retrieve the column value as a date based on column name
 double getDouble(int column)
          Get the value of a column in the current row as a Java double.
 double getDouble(java.lang.String name)
          Retrieve the column value as a double based on column name
 float getFloat(int column)
          Get the value of a column in the current row as a Java float.
 float getFloat(java.lang.String name)
          Retrieve the column value as a float based on column name
 int getInt(int column)
          Get the value of a column in the current row as a Java int.
 int getInt(java.lang.String name)
          Retreive the column value as a int based on column name
 long getLong(int column)
          Get the value of a column in the current row as a Java long.
 long getLong(java.lang.String name)
          Retrieve the column value as a long based on column name
 java.sql.ResultSetMetaData getMetaData()
          return meta-data on a result set.
 java.lang.Object getObject(int column)
          Get the value of a column in the current row as a Java Object.
 java.lang.Object getObject(int column, int type)
          Get the value of a column in the current row as a Java Object.
 java.lang.Object getObject(int column, int type, int scale)
          Get the value of a column in the current row as a Java Object.
 java.lang.Object getObject(java.lang.String name)
          Same as above, except returning the default SQL type
 java.lang.Object getObject(java.lang.String name, int type)
          Get the value of a column as an object; an integral value is returned as its java.lang equivalent object; a LONGVARCHAR or LONGVARBINARY value is returned as a java.io.InputStream.
 java.lang.Object getObject(java.lang.String name, int type, int scale)
          Get the value of a column as an object; an integral value is returned as its java.lang equivalent object; a LONGVARCHAR or LONGVARBINARY value is returned as a java.io.InputStream.
 short getShort(int column)
          Get the value of a column in the current row as a Java short.
 short getShort(java.lang.String name)
          Retrieve the column value as a short based on column name
 java.lang.String getString(int column)
          Get the value of a column in the current row as a Java string.
 java.lang.String getString(java.lang.String name)
          Get the value of a column in the current row as a Java String.
 java.sql.Time getTime(int column)
          Get the value of a column in the current row as a Java time.
 java.sql.Time getTime(java.lang.String name)
          Retrieve the column value as a time based on column name
 java.sql.Timestamp getTimestamp(int column)
          Get the value of a column in the current row as a Java timestamp.
 java.sql.Timestamp getTimestamp(java.lang.String name)
          Retrieve the column value as a timestamp based on column name
 java.io.InputStream getUnicodeStream(int column)
          Get the value of a column in the current row as a Java UnicodeStream.
 java.io.InputStream getUnicodeStream(java.lang.String name)
          Very large unicode values in a LONGVARCHAR column can be read in small chunks from a java.io.InputStream.
 java.sql.SQLWarning getWarnings()
          Return warning message
 boolean isNull(int column)
          JDBC specification method to determine if a column is null.
 boolean isNull(java.lang.String name)
          column is NULL?
 boolean next()
          Move to the next row of record, return true if there is one
 boolean wasNull()
          JDBC specification method to determine if the last column read was null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

vortexResultSet

public vortexResultSet(vortexRecord red)
                throws java.sql.SQLException
Constructs a new result set object
Parameters:
red - the vortexRecord returned from a previously executed query
Throws:
java.sql.SQLException - Not used.
Method Detail

next

public boolean next()
             throws java.sql.SQLException
Move to the next row of record, return true if there is one
Specified by:
next in interface java.sql.ResultSet
Returns:
true if there are more rows to process, otherwise false
Throws:
java.sql.SQLException - thrown if an error occurs during processing
See Also:
ResultSet.next()

isNull

public boolean isNull(int column)
               throws java.sql.SQLException
JDBC specification method to determine if a column is null.
Parameters:
column - the column being tested for nullness
Returns:
true if the column is null, false otherwise
Throws:
java.sql.SQLException - thrown if column out of range
Since:
JDBC 1.01.

wasNull

public boolean wasNull()
                throws java.sql.SQLException
JDBC specification method to determine if the last column read was null.
Specified by:
wasNull in interface java.sql.ResultSet
Returns:
true if the column was null, false otherwise
Throws:
java.sql.SQLException - thrown if column out of range
See Also:
ResultSet.wasNull()

getString

public java.lang.String getString(int column)
                           throws java.sql.SQLException
Get the value of a column in the current row as a Java string.
Specified by:
getString in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the column as a String
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getString(int)

getByte

public byte getByte(int column)
             throws java.sql.SQLException
Get the value of a column in the current row as a Java byte.
Specified by:
getByte in interface java.sql.ResultSet
Parameters:
column - the first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL the result is 0
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows

getBoolean

public boolean getBoolean(int column)
                   throws java.sql.SQLException
Get the value of a column in the current row as a Java boolean. Interprets "", null, and "0" as false, others as true.
Specified by:
getBoolean in interface java.sql.ResultSet
Parameters:
column - the column for which the value is being retrieved
Returns:
false for "", null, or "0"; true otherwise
Throws:
java.sql.SQLException - a sure sign of the apocolypse
See Also:
ResultSet.getBoolean(int)

getShort

public short getShort(int column)
               throws java.sql.SQLException
Get the value of a column in the current row as a Java short.
Specified by:
getShort in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the named column as a short
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getShort(int)

getInt

public int getInt(int column)
           throws java.sql.SQLException
Get the value of a column in the current row as a Java int.
Specified by:
getInt in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the named column as an integer
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getInt(int)

getLong

public long getLong(int column)
             throws java.sql.SQLException
Get the value of a column in the current row as a Java long.
Specified by:
getLong in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the named column as a short
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getLong(int)

getFloat

public float getFloat(int column)
               throws java.sql.SQLException
Get the value of a column in the current row as a Java float.
Specified by:
getFloat in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the named column as a float
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getFloat(int)

getDouble

public double getDouble(int column)
                 throws java.sql.SQLException
Get the value of a column in the current row as a Java double.
Specified by:
getDouble in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the named column as a double
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getDouble(int)

getBigDecimal

public java.math.BigDecimal getBigDecimal(int column,
                                          int scale)
                                   throws java.sql.SQLException
Get the value of a column in the current row as a Java BigDecimal.
Specified by:
getBigDecimal in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
scale - how many decimal digits after the floating point to maintain
Returns:
the named column as a Numeric
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getBigDecimal(int)

getBytes

public byte[] getBytes(int column)
                throws java.sql.SQLException
Get the value of a column in the current row as a Java byte array.
Specified by:
getBytes in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
a byte array that is the value of the column
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getBytes(int)

getDate

public java.sql.Date getDate(int column)
                      throws java.sql.SQLException
Get the value of a column in the current row as a Java date.
Specified by:
getDate in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the date value for the column
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getDate(int)

getTime

public java.sql.Time getTime(int column)
                      throws java.sql.SQLException
Get the value of a column in the current row as a Java time.
Specified by:
getTime in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the column as a java.sql.Time object
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getTime(int)

getTimestamp

public java.sql.Timestamp getTimestamp(int column)
                                throws java.sql.SQLException
Get the value of a column in the current row as a Java timestamp.
Specified by:
getTimestamp in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the column as a java.sql.Timestamp object
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getTimestamp(int)

getAsciiStream

public java.io.InputStream getAsciiStream(int column)
                                   throws java.sql.SQLException
Get the value of a column in the current row as a Java AsciiStream.
Specified by:
getAsciiStream in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the column as a java.io.InputStream object
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getAsciiStream(int)

getUnicodeStream

public java.io.InputStream getUnicodeStream(int column)
                                     throws java.sql.SQLException
Get the value of a column in the current row as a Java UnicodeStream.
Specified by:
getUnicodeStream in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the column as a java.io.InputStream object
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getAsciiStream(int)

getBinaryStream

public java.io.InputStream getBinaryStream(int column)
                                    throws java.sql.SQLException
Get the value of a column in the current row as a Java BinaryStream.
Specified by:
getBinaryStream in interface java.sql.ResultSet
Parameters:
column - the column being retrieved
Returns:
the column as a java.io.InputStream object
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getBinaryStream(int)

close

public void close()
           throws java.sql.SQLException
Close a result set.
Specified by:
close in interface java.sql.ResultSet
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.close()

getCursorName

public java.lang.String getCursorName()
                               throws java.sql.SQLException
Return a cursor name
Specified by:
getCursorName in interface java.sql.ResultSet
Returns:
"" for now
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getCursorName()

getMetaData

public java.sql.ResultSetMetaData getMetaData()
                                       throws java.sql.SQLException
return meta-data on a result set.
Specified by:
getMetaData in interface java.sql.ResultSet
Returns:
ResultSetMetaData object containing result set info
Throws:
java.sql.SQLException - thrown on error getting meta-data
See Also:
ResultSet.getMetaData()

getObject

public java.lang.Object getObject(int column,
                                  int type,
                                  int scale)
                           throws java.sql.SQLException
Get the value of a column in the current row as a Java Object.
Parameters:
column - the column desired
type - the SQL data type of the field
Returns:
the column specified as an Object
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
See Also:
ResultSet.getObject(int)

getObject

public java.lang.Object getObject(int column,
                                  int type)
                           throws java.sql.SQLException
Get the value of a column in the current row as a Java Object. Uses a default scale of 0.
Parameters:
column - The SQL column index
type - SQL type code defined by java.sql.Types
Returns:
the column specified as an Object
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows
Since:
JDBC 1.01.

getObject

public java.lang.Object getObject(int column)
                           throws java.sql.SQLException
Get the value of a column in the current row as a Java Object. Uses the column's default SQL type.
Specified by:
getObject in interface java.sql.ResultSet
Parameters:
column - The SQL column index
type - SQL type code defined by java.sql.Types
Returns:
the column specified as an Object
Throws:
java.sql.SQLException - thrown for invalid columns or bad rows

getString

public java.lang.String getString(java.lang.String name)
                           throws java.sql.SQLException
Get the value of a column in the current row as a Java String.
Specified by:
getString in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a char string
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getString(int)

getByte

public byte getByte(java.lang.String name)
             throws java.sql.SQLException
Get the value of a column in the current row as a Java byte.
Specified by:
getByte in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a byte
Throws:
java.sql.SQLException - if a database-access error occurs.
See Also:
ResultSet.getByte(int)

getBoolean

public boolean getBoolean(java.lang.String name)
                   throws java.sql.SQLException
Retrieve the column value as a boolean based on column name
Specified by:
getBoolean in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a boolean
Throws:
java.sql.SQLException - if a database-access error occurs.
See Also:
ResultSet.getBoolean(int)

getShort

public short getShort(java.lang.String name)
               throws java.sql.SQLException
Retrieve the column value as a short based on column name
Specified by:
getShort in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a short
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getShort(int)

getInt

public int getInt(java.lang.String name)
           throws java.sql.SQLException
Retreive the column value as a int based on column name
Specified by:
getInt in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a int
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getInt(int)

getLong

public long getLong(java.lang.String name)
             throws java.sql.SQLException
Retrieve the column value as a long based on column name
Specified by:
getLong in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a long
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getLong(int)

getFloat

public float getFloat(java.lang.String name)
               throws java.sql.SQLException
Retrieve the column value as a float based on column name
Specified by:
getFloat in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a float
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getFloat(int)

getDouble

public double getDouble(java.lang.String name)
                 throws java.sql.SQLException
Retrieve the column value as a double based on column name
Specified by:
getDouble in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a double
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getDouble(int)

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String name,
                                          int scale)
                                   throws java.sql.SQLException
Retrieve the column value as a numeric based on column name
Specified by:
getBigDecimal in interface java.sql.ResultSet
Parameters:
name - the column name
scale - the scale of the numeric column
Returns:
the value of the column as a numeric
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getBigDecimal(int)

getBytes

public byte[] getBytes(java.lang.String name)
                throws java.sql.SQLException
Retrieve the column value as a byte array based on column name
Specified by:
getBytes in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a byte array
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getByte(int)

getDate

public java.sql.Date getDate(java.lang.String name)
                      throws java.sql.SQLException
Retrieve the column value as a date based on column name
Specified by:
getDate in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a date
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getDate(int)

getTime

public java.sql.Time getTime(java.lang.String name)
                      throws java.sql.SQLException
Retrieve the column value as a time based on column name
Specified by:
getTime in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a time
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getTime(int)

getTimestamp

public java.sql.Timestamp getTimestamp(java.lang.String name)
                                throws java.sql.SQLException
Retrieve the column value as a timestamp based on column name
Specified by:
getTimestamp in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the value of the column as a timestamp
Throws:
java.sql.SQLException - do nothing
See Also:
ResultSet.getTimestamp(int)

getAsciiStream

public java.io.InputStream getAsciiStream(java.lang.String name)
                                   throws java.sql.SQLException
Very large ascii values in a LONGVARCHAR column can be read in small chunks from a java.io.InputStream.

Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getAsciiStream in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the java input stream which contains the ascii value
Throws:
java.sql.SQLException - Not used

getUnicodeStream

public java.io.InputStream getUnicodeStream(java.lang.String name)
                                     throws java.sql.SQLException
Very large unicode values in a LONGVARCHAR column can be read in small chunks from a java.io.InputStream.

Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getUnicodeStream in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the java input stream which contains the unicode value
Throws:
java.sql.SQLException - Not used

getBinaryStream

public java.io.InputStream getBinaryStream(java.lang.String name)
                                    throws java.sql.SQLException
Very large binary values in a LONGVARBINARY column can be read in small chunks from a java.io.InputStream.

Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getBinaryStream in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the java input stream which contains the binary value
Throws:
java.sql.SQLException - Not used

getObject

public java.lang.Object getObject(java.lang.String name,
                                  int type,
                                  int scale)
                           throws java.sql.SQLException
Get the value of a column as an object; an integral value is returned as its java.lang equivalent object; a LONGVARCHAR or LONGVARBINARY value is returned as a java.io.InputStream.
Parameters:
name - the column name
type - SQL type code defined by java.sql.Types
Returns:
the parameter value; if isNull the value is null
Throws:
java.sql.SQLException - Not used
Since:
JDBC 1.01.

getObject

public java.lang.Object getObject(java.lang.String name,
                                  int type)
                           throws java.sql.SQLException
Get the value of a column as an object; an integral value is returned as its java.lang equivalent object; a LONGVARCHAR or LONGVARBINARY value is returned as a java.io.InputStream. Uses default scale of 0.
Parameters:
name - the column name
type - SQL type code defined by java.sql.Types
Returns:
the column specified as an Object
Throws:
java.sql.SQLException -  
Since:
JDBC 1.01.

getObject

public java.lang.Object getObject(java.lang.String name)
                           throws java.sql.SQLException
Same as above, except returning the default SQL type
Specified by:
getObject in interface java.sql.ResultSet
Parameters:
name - the column name
Returns:
the column specified as an Object
Throws:
java.sql.SQLException -  

isNull

public boolean isNull(java.lang.String name)
               throws java.sql.SQLException
column is NULL?
Parameters:
name - the column name
Returns:
true to indicate the column is NULL, otherwise return false.
Throws:
java.sql.SQLException - Not used
Since:
JDBC 1.01.

findColumn

public int findColumn(java.lang.String name)
               throws java.sql.SQLException
Given a column name, this method returns the column index for that name. Column name to number mappings are kept inside a Hashtable.
Specified by:
findColumn in interface java.sql.ResultSet
Parameters:
name - the name of the column desired
Returns:
the column number, 1 being the first column
Throws:
java.sql.SQLException - thrown if a bad name is passed

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Return warning message
Specified by:
getWarnings in interface java.sql.ResultSet
Returns:
the chain of warnings
Throws:
java.sql.SQLException - Not used
See Also:
Statement.getWarnings()

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
Clear the warning chain.
Specified by:
clearWarnings in interface java.sql.ResultSet
Throws:
java.sql.SQLException - Not used
See Also:
Statement.clearWarnings()