Class RowDataStatic
java.lang.Object
com.mysql.jdbc.RowDataStatic
- All Implemented Interfaces:
RowData
-
Field Summary
FieldsFields inherited from interface RowData
RESULT_SET_SIZE_UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRow(ResultSetRow row) Adds a row to this row data.voidMoves to after last.voidMoves to before first.voidMoves to before last so next el is the last el.voidclose()We're done.getAt(int atIndex) Only works on non dynamic result sets.intReturns the current position in the result set as a row number.getOwner()Returns the result set that 'owns' this RowDatabooleanhasNext()Returns true if another row exsists.booleanReturns true if we got the last element.booleanReturns if iteration has not occurred yet.booleanReturns true if the result set is dynamic.booleanisEmpty()Has no records.booleanisFirst()Are we on the first row of the result set?booleanisLast()Are we on the last row of the result set?voidmoveRowRelative(int rowsToMove) Moves the current position relative 'rows' from the current position.next()Returns the next row.voidremoveRow(int atIndex) Removes the row at the given index.voidsetCurrentRow(int newIndex) Moves the current position in the result set to the given row number.voidsetMetadata(Field[] metadata) Sometimes the driver doesn't have metadata until after the statement has the result set in-hand (because it's cached), so it can call this to set it after the fact.voidSet the result set that 'owns' this RowDataintsize()Only works on non dynamic result sets.booleanwasEmpty()Did this result set have no rows?
-
Field Details
-
owner
ResultSetImpl owner
-
-
Constructor Details
-
RowDataStatic
Creates a new RowDataStatic object.- Parameters:
rows-
-
-
Method Details
-
addRow
Description copied from interface:RowDataAdds a row to this row data. -
afterLast
-
beforeFirst
-
beforeLast
public void beforeLast()Description copied from interface:RowDataMoves to before last so next el is the last el.- Specified by:
beforeLastin interfaceRowData
-
close
-
getAt
Description copied from interface:RowDataOnly works on non dynamic result sets.- Specified by:
getAtin interfaceRowData- Parameters:
atIndex- row number to get at- Returns:
- row data at index
- Throws:
SQLException- if a database error occurs
-
getCurrentRowNumber
public int getCurrentRowNumber()Description copied from interface:RowDataReturns the current position in the result set as a row number.- Specified by:
getCurrentRowNumberin interfaceRowData- Returns:
- the current row number
-
getOwner
Description copied from interface:RowDataReturns the result set that 'owns' this RowData -
hasNext
-
isAfterLast
public boolean isAfterLast()Returns true if we got the last element.- Specified by:
isAfterLastin interfaceRowData- Returns:
- true if after last row
-
isBeforeFirst
public boolean isBeforeFirst()Returns if iteration has not occurred yet.- Specified by:
isBeforeFirstin interfaceRowData- Returns:
- true if before first row
-
isDynamic
public boolean isDynamic()Description copied from interface:RowDataReturns 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. -
isEmpty
-
isFirst
-
isLast
-
moveRowRelative
public void moveRowRelative(int rowsToMove) Description copied from interface:RowDataMoves the current position relative 'rows' from the current position.- Specified by:
moveRowRelativein interfaceRowData- Parameters:
rowsToMove- the relative number of rows to move
-
next
Description copied from interface:RowDataReturns the next row.- Specified by:
nextin interfaceRowData- Returns:
- the next row value
- Throws:
SQLException- if a database error occurs
-
removeRow
-
setCurrentRow
public void setCurrentRow(int newIndex) Description copied from interface:RowDataMoves the current position in the result set to the given row number.- Specified by:
setCurrentRowin interfaceRowData- Parameters:
newIndex- row to move to
-
setOwner
Description copied from interface:RowDataSet the result set that 'owns' this RowData -
size
-
wasEmpty
-
setMetadata
Description copied from interface:RowDataSometimes the driver doesn't have metadata until after the statement has the result set in-hand (because it's cached), so it can call this to set it after the fact.- Specified by:
setMetadatain interfaceRowData- Parameters:
metadata- field-level metadata for the result set
-