unity.query
Class ResultRowData

java.lang.Object
  extended by unity.query.ResultRowData

public class ResultRowData
extends java.lang.Object


Constructor Summary
ResultRowData(GlobalQuery gq, int rsType)
          The constructor initializes most of the instance variables with defaults
 
Method Summary
 boolean absolute(int row)
          Moves the cursor to the given row number in the ResultSet object.
 void afterLast()
          Moves the cursor to the end of this ResultSet object, just after the last row.
 boolean appendTuple(Tuple row)
          This method is currently not supported in the UnityJDBC driver.
 void beforeFirst()
          Moves the cursor to the front of this ResultSet object, just before the first row.
 void close()
           Releases resources immediately instead of waiting for this to happen when it is automatically closed.
 void deleteRow()
          This method is currently not supported in the UnityJDBC driver.
 boolean first()
          Moves the cursor to the first row
 int getFetchSize()
           
 GlobalQuery getGlobalQuery()
           
 java.lang.Object getObject(int columnIndex)
           Gets the value of the designated column in the current row as an Object in the Java programming language.
 int getRow()
           
 void insertRow()
          Inserts the contents of the insert row into this ResultSet object and into the database.
 boolean isAfterLast()
          Retrieves whether the cursor is after the last row.
 boolean isBeforeFirst()
          Moves the cursor to the front, just before the first row.
 boolean isFirst()
          Retrieves whether the cursor is on the first row.
 boolean isLast()
          Retrieves whether the cursor is on the last row.
 boolean last()
          Moves the cursor to the last row.
 void moveToInsertRow()
          Moves the cursor to the insert row.
 boolean next()
           Moves the cursor down one row from its current position.
 boolean previous()
          Moves the cursor to the previous row.
 boolean relative(int index)
           
 void setFetchSize(int _fetchsize)
           
 void updateArray(int columnIndex, java.sql.Array x)
          Updates the designated column with a java.sql.Array value.
 void updateAsciiStream(int columnIndex, java.io.InputStream x, int length)
          This method is currently not supported.
 void updateBigDecimal(int columnIndex, java.math.BigDecimal x)
          Updates the designated column with a java.math.BigDecimal value.
 void updateBinaryStream(int columnIndex, java.io.InputStream x, int length)
          Updates the designated column with a binary stream value.
 void updateBlob(int columnIndex, java.sql.Blob x)
          Updates the designated column with a java.sql.Blob value.
 void updateBoolean(int columnIndex, boolean x)
          Updates the designated column with a boolean value.
 void updateByte(int columnIndex, byte x)
          Updates the designated column with a Byte value.
 void updateBytes(int columnIndex, byte[] x)
          Updates the designated column with a Byte array value.
 void updateCharacterStream(int columnIndex, java.io.Reader x, int length)
          This method is currently not supported.
 void updateClob(int columnIndex, java.sql.Clob x)
          Updates the designated column with a java.sql.Clob value.
 void updateDate(int columnIndex, java.sql.Date x)
          Updates the designated column with a java.sql.Date value.
 void updatedouble(int columnIndex, double x)
          Updates the designated column with a double value.
 void updateFloat(int columnIndex, float x)
          Updates the designated column with a float value.
 void updateInt(int columnIndex, int x)
          Updates the designated column with an int value.
 void updateLong(int columnIndex, long x)
          Updates the designated column with a long value.
 void updateNull(int columnIndex)
          Updates the designated column with a null value.
 void updateObject(int columnIndex, java.lang.Object x)
          Updates the designated column with an Object value.
 void updateObject(int columnIndex, java.lang.Object x, int scale)
          This method is currently not supported.
 void updateRef(int columnIndex, java.sql.Ref x)
          Updates the designated column with a java.sql.Ref value.
 void updateRow()
          Updates the underlying database with the new contents of the current row of this ResultSet object.
 void updateShort(int columnIndex, short x)
          Updates the designated column with a short value.
 void updateString(int columnIndex, java.lang.String x)
          Updates the designated column with a String value.
 void updateTime(int columnIndex, java.sql.Time x)
          Updates the designated column with a java.sql.Time value.
 void updateTimeStamp(int columnIndex, java.sql.Timestamp x)
          Updates the designated column with a Timestamp value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultRowData

public ResultRowData(GlobalQuery gq,
                     int rsType)
              throws java.sql.SQLException
The constructor initializes most of the instance variables with defaults

Parameters:
gq - requires a GlobalQuery object
rsType - requires the type of ResultSet created.
Throws:
java.sql.SQLException
Method Detail

getGlobalQuery

public GlobalQuery getGlobalQuery()
Returns:
Returns the globalQuery object.

getRow

public int getRow()
Returns:
Returns index of the current tuple in the ResultSet Results are numbered 1...n for the user.

absolute

public boolean absolute(int row)
                 throws java.sql.SQLException
Moves the cursor to the given row number in the ResultSet object.

If the row number is positive, the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1, the second is row 2, and so on.

If the given row number is negative, the cursor moves to an absolute row position with respect to the end of the result set. For example, calling the method absolute(-1) positions the cursor on the last row; calling the method absolute(-2) moves the cursor to the next-to-last row, and so on.

An attempt to position the cursor beyond the first/last row in the result set leaves the cursor before the first row or after the last row.

Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().

Parameters:
row - the number of the row to which the cursor should move. A positive number indicates the row number counting from the beginning of the result set; a negative number indicates the row number counting from the end of the result set
Returns:
true if the cursor is on the result set; false otherwise
Throws:
java.sql.SQLException - if a database access error occurs, or the result set type is TYPE_FORWARD_ONLY

next

public boolean next()
             throws java.sql.SQLException

Moves the cursor down one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on.

Also handles cases when the next tuples are already cached on disk.

Note: While this method has a similar footprint to UnityResultSet.next(), it is this method that does the actual progression through the ResultSet .

Returns:
true if the new current row is valid; false if there are no more rows
Throws:
java.sql.SQLException - if a database access error occurs

afterLast

public void afterLast()
Moves the cursor to the end of this ResultSet object, just after the last row. This method has no effect if the result set contains no rows.

Throws:
java.sql.SQLException - if a database access error occurs or the result set type is ResultSet.TYPE_FORWARD_ONLY

beforeFirst

public void beforeFirst()
                 throws java.sql.SQLException
Moves the cursor to the front of this ResultSet object, just before the first row. This method has no effect if the result set contains no rows.

Throws:
java.sql.SQLException - if a database access error occurs or the result set type is ResultSet.TYPE_FORWARD_ONLY

deleteRow

public void deleteRow()
               throws java.sql.SQLException
This method is currently not supported in the UnityJDBC driver.

Throws:
java.sql.SQLException - because method is not supported.

first

public boolean first()
              throws java.sql.SQLException
Moves the cursor to the first row

Returns:
true if the cursor is on a valid row; false if there are no rows in the result set
Throws:
java.sql.SQLException - if a database access error occurs or the result set type is TYPE_FORWARD_ONLY

appendTuple

public boolean appendTuple(Tuple row)
                    throws java.sql.SQLException
This method is currently not supported in the UnityJDBC driver.

Throws:
java.sql.SQLException - because method is not supported.

getObject

public java.lang.Object getObject(int columnIndex)

Gets the value of the designated column in the current row as an Object in the Java programming language.

This method will return the value of the given column as a Java object. The type of the Java object will be the default Java object type corresponding to the column's SQL type, following the mapping for built-in types specified in the JDBC specification. If the value is an SQL NULL, the driver returns a Java null.

This method may also be used to read datatabase-specific abstract data types.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
a java.lang.Object holding the column value or null if called before next() using a scrollable ResultSet
Throws:
java.sql.SQLException - if a database access error occurs

isAfterLast

public boolean isAfterLast()
Retrieves whether the cursor is after the last row.

Returns:
true if the cursor is after the last row; false if the cursor is at any other position or the result set contains no rows
Throws:
java.sql.SQLException - if a database access error occurs

isBeforeFirst

public boolean isBeforeFirst()
Moves the cursor to the front, just before the first row. This method has no effect if the result set contains no rows.

Throws:
java.sql.SQLException - if a database access error occurs or the result set type is TYPE_FORWARD_ONLY

isFirst

public boolean isFirst()
Retrieves whether the cursor is on the first row.

Returns:
true if the cursor is on the first row; false otherwise
Throws:
java.sql.SQLException - if a database access error occurs

isLast

public boolean isLast()
Retrieves whether the cursor is on the last row. Note: Calling the method isLast may be expensive because the JDBC driver might need to fetch ahead one row in order to determine whether the current row is the last row in the result set.

Returns:
true if the cursor is on the last row; false otherwise
Throws:
java.sql.SQLException - if a database access error occurs

last

public boolean last()
             throws java.sql.SQLException
Moves the cursor to the last row.

Returns:
true if the cursor is on a valid row; false if there are no rows in the result set
Throws:
java.sql.SQLException - if a database access error occurs or the result set type is ResultSet.TYPE_FORWARD_ONLY

close

public void close()
           throws java.io.IOException

Releases resources immediately instead of waiting for this to happen when it is automatically closed.

Also deletes all temporary files/folders created to cache the results.

Note: A ResultSet object is automatically closed by the Statement object that generated it when that Statement object is closed, re-executed, or is used to retrieve the next result from a sequence of multiple results. A ResultSet object is also automatically closed when it is garbage collected.

Throws:
java.sql.SQLException - if a database access error occurs
java.io.IOException

previous

public boolean previous()
                 throws java.sql.SQLException
Moves the cursor to the previous row.

Returns:
true if the cursor is on a valid row; false if it is off the result set
Throws:
java.sql.SQLException - if a database access error occurs or the result set type is ResultSet.TYPE_FORWARD_ONLY

relative

public boolean relative(int index)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

setFetchSize

public void setFetchSize(int _fetchsize)

getFetchSize

public int getFetchSize()

updateString

public void updateString(int columnIndex,
                         java.lang.String x)
                  throws java.sql.SQLException
Updates the designated column with a String value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateArray

public void updateArray(int columnIndex,
                        java.sql.Array x)
                 throws java.sql.SQLException
Updates the designated column with a java.sql.Array value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateAsciiStream

public void updateAsciiStream(int columnIndex,
                              java.io.InputStream x,
                              int length)
                       throws java.sql.SQLException
This method is currently not supported.

Parameters:
columnIndex -
x -
length -
Throws:
java.sql.SQLException - Throws SQLException because this version of the driver does not support this method.

updateBigDecimal

public void updateBigDecimal(int columnIndex,
                             java.math.BigDecimal x)
                      throws java.sql.SQLException
Updates the designated column with a java.math.BigDecimal value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateBinaryStream

public void updateBinaryStream(int columnIndex,
                               java.io.InputStream x,
                               int length)
                        throws java.sql.SQLException
Updates the designated column with a binary stream value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
length - the length of the stream
Throws:
java.sql.SQLException - if a database access error occurs

updateBlob

public void updateBlob(int columnIndex,
                       java.sql.Blob x)
                throws java.sql.SQLException
Updates the designated column with a java.sql.Blob value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateBoolean

public void updateBoolean(int columnIndex,
                          boolean x)
                   throws java.sql.SQLException
Updates the designated column with a boolean value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateByte

public void updateByte(int columnIndex,
                       byte x)
                throws java.sql.SQLException
Updates the designated column with a Byte value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateBytes

public void updateBytes(int columnIndex,
                        byte[] x)
                 throws java.sql.SQLException
Updates the designated column with a Byte array value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateCharacterStream

public void updateCharacterStream(int columnIndex,
                                  java.io.Reader x,
                                  int length)
                           throws java.sql.SQLException
This method is currently not supported.

Parameters:
columnIndex -
x -
length -
Throws:
java.sql.SQLException - Throws SQLException because this version of the driver does not support this method.

updateClob

public void updateClob(int columnIndex,
                       java.sql.Clob x)
                throws java.sql.SQLException
Updates the designated column with a java.sql.Clob value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateDate

public void updateDate(int columnIndex,
                       java.sql.Date x)
                throws java.sql.SQLException
Updates the designated column with a java.sql.Date value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updatedouble

public void updatedouble(int columnIndex,
                         double x)
                  throws java.sql.SQLException
Updates the designated column with a double value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateFloat

public void updateFloat(int columnIndex,
                        float x)
                 throws java.sql.SQLException
Updates the designated column with a float value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateInt

public void updateInt(int columnIndex,
                      int x)
               throws java.sql.SQLException
Updates the designated column with an int value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateLong

public void updateLong(int columnIndex,
                       long x)
                throws java.sql.SQLException
Updates the designated column with a long value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateNull

public void updateNull(int columnIndex)
                throws java.sql.SQLException
Updates the designated column with a null value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateObject

public void updateObject(int columnIndex,
                         java.lang.Object x)
                  throws java.sql.SQLException
Updates the designated column with an Object value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateObject

public void updateObject(int columnIndex,
                         java.lang.Object x,
                         int scale)
                  throws java.sql.SQLException
This method is currently not supported.

Parameters:
columnIndex -
x -
scale -
Throws:
java.sql.SQLException - Throws SQLException because this version of the driver does not support this method.

updateRef

public void updateRef(int columnIndex,
                      java.sql.Ref x)
               throws java.sql.SQLException
Updates the designated column with a java.sql.Ref value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateRow

public void updateRow()
               throws java.sql.SQLException
Updates the underlying database with the new contents of the current row of this ResultSet object. This method cannot be called when the cursor is on the insert row.

Throws:
java.sql.SQLException - if a database access error occurs or if this method is called when the cursor is on the insert row

updateShort

public void updateShort(int columnIndex,
                        short x)
                 throws java.sql.SQLException
Updates the designated column with a short value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateTime

public void updateTime(int columnIndex,
                       java.sql.Time x)
                throws java.sql.SQLException
Updates the designated column with a java.sql.Time value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

updateTimeStamp

public void updateTimeStamp(int columnIndex,
                            java.sql.Timestamp x)
                     throws java.sql.SQLException
Updates the designated column with a Timestamp value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
x - the new column value
Throws:
java.sql.SQLException - if a database access error occurs

moveToInsertRow

public void moveToInsertRow()
Moves the cursor to the insert row. The current cursor position is remembered while the cursor is positioned on the insert row. The insert row is a special row associated with an updatable result set. It is essentially a buffer where a new row may be constructed by calling the updater methods prior to inserting the row into the result set. Only the updater, getter, and insertRow methods may be called when the cursor is on the insert row. All of the columns in a result set must be given a value each time this method is called before calling insertRow. An updater method must be called before a getter method can be called on a column value.

Throws:
java.sql.SQLException - if a database access error occurs or the result set is not updatable

insertRow

public void insertRow()
               throws java.sql.SQLException
Inserts the contents of the insert row into this ResultSet object and into the database. The cursor must be on the insert row when this method is called.

Throws:
java.sql.SQLException - if a database access error occurs, if this method is called when the cursor is not on the insert row, or if not all of non-nullable columns in the insert row have been given a value