MySQL Connector/J size='-1'>5.0.8

com.mysql.jdbc
Interface RowData

All Known Implementing Classes:
CursorRowProvider, RowDataDynamic, RowDataStatic

public interface RowData

This interface abstracts away how row data is accessed by the result set. It is meant to allow a static implementation (Current version), and a streaming one.

Author:
dgan

Field Summary
static int RESULT_SET_SIZE_UNKNOWN
          What's returned for the size of a result set when its size can not be determined.
 
Method Summary
 void addRow(byte[][] row)
          Adds a row to this row data.
 void afterLast()
          Moves to after last.
 void beforeFirst()
          Moves to before first.
 void beforeLast()
          Moves to before last so next el is the last el.
 void close()
          We're done.
 java.lang.Object[] getAt(int index)
          Only works on non dynamic result sets.
 int getCurrentRowNumber()
          Returns the current position in the result set as a row number.
 ResultSet getOwner()
          Returns the result set that 'owns' this RowData
 boolean hasNext()
          Returns true if another row exsists.
 boolean isAfterLast()
          Returns true if we got the last element.
 boolean isBeforeFirst()
          Returns if iteration has not occured yet.
 boolean isDynamic()
          Returns true if the result set is dynamic.
 boolean isEmpty()
          Has no records.
 boolean isFirst()
          Are we on the first row of the result set?
 boolean isLast()
          Are we on the last row of the result set?
 void moveRowRelative(int rows)
          Moves the current position relative 'rows' from the current position.
 java.lang.Object[] next()
          Returns the next row.
 void removeRow(int index)
          Removes the row at the given index.
 void setCurrentRow(int rowNumber)
          Moves the current position in the result set to the given row number.
 void setOwner(ResultSet rs)
          Set the result set that 'owns' this RowData
 int size()
          Only works on non dynamic result sets.
 boolean wasEmpty()
          Did this result set have no rows?
 

Field Detail

RESULT_SET_SIZE_UNKNOWN

public static final int RESULT_SET_SIZE_UNKNOWN
What's returned for the size of a result set when its size can not be determined.

See Also:
Constant Field Values
Method Detail

addRow

public void addRow(byte[][] row)
            throws java.sql.SQLException
Adds a row to this row data.

Parameters:
row - the row to add
Throws:
java.sql.SQLException - if a database error occurs

afterLast

public void afterLast()
               throws java.sql.SQLException
Moves to after last.

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

beforeFirst

public void beforeFirst()
                 throws java.sql.SQLException
Moves to before first.

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

beforeLast

public void beforeLast()
                throws java.sql.SQLException
Moves to before last so next el is the last el.

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

close

public void close()
           throws java.sql.SQLException
We're done.

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

getAt

public java.lang.Object[] getAt(int index)
                         throws java.sql.SQLException
Only works on non dynamic result sets.

Parameters:
index - row number to get at
Returns:
row data at index
Throws:
java.sql.SQLException - if a database error occurs

getCurrentRowNumber

public int getCurrentRowNumber()
                        throws java.sql.SQLException
Returns the current position in the result set as a row number.

Returns:
the current row number
Throws:
java.sql.SQLException - if a database error occurs

getOwner

public ResultSet getOwner()
Returns the result set that 'owns' this RowData


hasNext

public boolean hasNext()
                throws java.sql.SQLException
Returns true if another row exsists.

Returns:
true if more rows
Throws:
java.sql.SQLException - if a database error occurs

isAfterLast

public boolean isAfterLast()
                    throws java.sql.SQLException
Returns true if we got the last element.

Returns:
true if after last row
Throws:
java.sql.SQLException - if a database error occurs

isBeforeFirst

public boolean isBeforeFirst()
                      throws java.sql.SQLException
Returns if iteration has not occured yet.

Returns:
true if before first row
Throws:
java.sql.SQLException - if a database error occurs

isDynamic

public boolean isDynamic()
                  throws java.sql.SQLException
Returns true if the result set is dynamic. This means that move back and move forward won't work because we do not hold on to the records.

Returns:
true if this result set is streaming from the server
Throws:
java.sql.SQLException - if a database error occurs

isEmpty

public boolean isEmpty()
                throws java.sql.SQLException
Has no records.

Returns:
true if no records
Throws:
java.sql.SQLException - if a database error occurs

isFirst

public boolean isFirst()
                throws java.sql.SQLException
Are we on the first row of the result set?

Returns:
true if on first row
Throws:
java.sql.SQLException - if a database error occurs

isLast

public boolean isLast()
               throws java.sql.SQLException
Are we on the last row of the result set?

Returns:
true if on last row
Throws:
java.sql.SQLException - if a database error occurs

moveRowRelative

public void moveRowRelative(int rows)
                     throws java.sql.SQLException
Moves the current position relative 'rows' from the current position.

Parameters:
rows - the relative number of rows to move
Throws:
java.sql.SQLException - if a database error occurs

next

public java.lang.Object[] next()
                        throws java.sql.SQLException
Returns the next row.

Returns:
the next row value
Throws:
java.sql.SQLException - if a database error occurs

removeRow

public void removeRow(int index)
               throws java.sql.SQLException
Removes the row at the given index.

Parameters:
index - the row to move to
Throws:
java.sql.SQLException - if a database error occurs

setCurrentRow

public void setCurrentRow(int rowNumber)
                   throws java.sql.SQLException
Moves the current position in the result set to the given row number.

Parameters:
rowNumber - row to move to
Throws:
java.sql.SQLException - if a database error occurs

setOwner

public void setOwner(ResultSet rs)
Set the result set that 'owns' this RowData

Parameters:
rs - the result set that 'owns' this RowData

size

public int size()
         throws java.sql.SQLException
Only works on non dynamic result sets.

Returns:
the size of this row data
Throws:
java.sql.SQLException - if a database error occurs

wasEmpty

public boolean wasEmpty()
Did this result set have no rows?


MySQL Connector/J size='-1'>5.0.8