Class RowDataCursor
java.lang.Object
com.mysql.jdbc.RowDataCursor
- All Implemented Interfaces:
RowData
-
Field Summary
Fields inherited from interface RowData
RESULT_SET_SIZE_UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionRowDataCursor(MysqlIO ioChannel, ServerPreparedStatement creatingStatement, Field[] metadata) Creates a new cursor-backed row provider. -
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 ind) 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 exists.booleanReturns true if we got the last element.booleanReturns if iteration has not occured 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 rows) Moves the current position relative 'rows' from the current position.next()Returns the next row.protected voidvoidremoveRow(int ind) Removes the row at the given index.voidsetCurrentRow(int rowNumber) 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?
-
Constructor Details
-
RowDataCursor
public RowDataCursor(MysqlIO ioChannel, ServerPreparedStatement creatingStatement, Field[] metadata) Creates a new cursor-backed row provider.- Parameters:
ioChannel- connection to the server.creatingStatement- statement that opened the cursor.metadata- field-level metadata for the results that this cursor covers.
-
-
Method Details
-
isAfterLast
public boolean isAfterLast()Returns true if we got the last element.- Specified by:
isAfterLastin interfaceRowData- Returns:
- true if after last row
-
getAt
Only works on non dynamic result sets.- Specified by:
getAtin interfaceRowData- Parameters:
ind- row number to get atindex- row number to get at- Returns:
- row data at index
- Throws:
SQLException- if a database error occurs
-
isBeforeFirst
Returns if iteration has not occured yet.- Specified by:
isBeforeFirstin interfaceRowData- Returns:
- true if before first row
- Throws:
SQLException- if a database error occurs
-
setCurrentRow
Moves the current position in the result set to the given row number.- Specified by:
setCurrentRowin interfaceRowData- Parameters:
rowNumber- row to move to- Throws:
SQLException- if a database error occurs
-
getCurrentRowNumber
Returns the current position in the result set as a row number.- Specified by:
getCurrentRowNumberin interfaceRowData- Returns:
- the current row number
- Throws:
SQLException- if a database error occurs
-
isDynamic
-
isEmpty
Has no records.- Specified by:
isEmptyin interfaceRowData- Returns:
- true if no records
- Throws:
SQLException- if a database error occurs
-
isFirst
Are we on the first row of the result set?- Specified by:
isFirstin interfaceRowData- Returns:
- true if on first row
- Throws:
SQLException- if a database error occurs
-
isLast
Are we on the last row of the result set?- Specified by:
isLastin interfaceRowData- Returns:
- true if on last row
- Throws:
SQLException- if a database error occurs
-
addRow
Adds a row to this row data.- Specified by:
addRowin interfaceRowData- Parameters:
row- the row to add- Throws:
SQLException- if a database error occurs
-
afterLast
Moves to after last.- Specified by:
afterLastin interfaceRowData- Throws:
SQLException- if a database error occurs
-
beforeFirst
Moves to before first.- Specified by:
beforeFirstin interfaceRowData- Throws:
SQLException- if a database error occurs
-
beforeLast
Moves to before last so next el is the last el.- Specified by:
beforeLastin interfaceRowData- Throws:
SQLException- if a database error occurs
-
close
We're done.- Specified by:
closein interfaceRowData- Throws:
SQLException- if a database error occurs
-
hasNext
Returns true if another row exists.- Specified by:
hasNextin interfaceRowData- Returns:
- true if more rows
- Throws:
SQLException- if a database error occurs
-
moveRowRelative
Moves the current position relative 'rows' from the current position.- Specified by:
moveRowRelativein interfaceRowData- Parameters:
rows- the relative number of rows to move- Throws:
SQLException- if a database error occurs
-
next
Returns the next row.- Specified by:
nextin interfaceRowData- Returns:
- the next row value
- Throws:
SQLException- if a database error occurs
-
removeRow
Removes the row at the given index.- Specified by:
removeRowin interfaceRowData- Parameters:
ind- the row to move toindex- the row to move to- Throws:
SQLException- if a database error occurs
-
size
-
nextRecord
- Throws:
SQLException
-
setOwner
Description copied from interface:RowDataSet the result set that 'owns' this RowData -
getOwner
Description copied from interface:RowDataReturns the result set that 'owns' this RowData -
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
-