Class Cursor
java.lang.Object
org.apache.derby.client.am.Cursor
- Direct Known Subclasses:
NetCursor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Agentprivate booleanstatic final intint[]private char[]Charset[]protected int[]protected ArrayList<boolean[]> protected ArrayList<int[]> protected int[]protected ArrayList<int[]> intprotected intbyte[]int[]booleanboolean[](package private) static final Charsetprivate boolean(package private) booleanint[]int(package private) intprivate intstatic final intstatic final intboolean[]intprivate Calendarprivate static final Boolean(package private) static final Boolean(package private) longstatic final int(package private) static final Charset(package private) static final Charsetstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal booleanReturntrueif all rows are received from the server.protected abstract booleancalculateColumnOffsetsForRow_(int row, boolean allowServerFetch) Calculate the column offsets for a row.protected abstract voidprivate ColumnTypeConversionExceptioncoercionError(String targetType, int sourceColumn) (package private) final boolean(package private) final booleanprivate final longget_BIGINT(int column) private booleanget_BOOLEAN(int column) private byte[]get_CHAR_FOR_BIT_DATA(int column) private final BigDecimalget_DECIMAL(int column) private final doubleget_DOUBLE(int column) private final floatget_FLOAT(int column) protected final intget_INTEGER(int column) private final shortget_SMALLINT(int column) private Objectget_UDT(int column) private byte[]get_VARCHAR_FOR_BIT_DATA(int column) (package private) final ArraygetArray(int column) (package private) final InputStreamgetAsciiStream(int column) (package private) final BigDecimalgetBigDecimal(int column) (package private) final InputStreamgetBinaryStream(int column) (package private) final BlobgetBlob(int column) abstract ClientBlobgetBlobColumn_(int column, Agent agent, boolean toBePublished) Returns aBlobobject.(package private) final booleangetBoolean(int column) (package private) final bytegetByte(int column) (package private) final byte[]getBytes(int column) private StringgetCHAR(int column) (package private) final ReadergetCharacterStream(int column) (package private) final ClobgetClob(int column) abstract ClientClobgetClobColumn_(int column, Agent agent, boolean toBePublished) Returns aClobobject.private intgetColumnPrecision(int column) private intgetColumnScale(int column) (package private) final Dateprivate Dateprivate final DategetDateFromTIMESTAMP(int column, Calendar cal) (package private) final doublegetDouble(int column) private doublegetDoubleFromDECIMAL(int column) (package private) final floatgetFloat(int column) (package private) final intgetInt(int column) final booleanGet updated status for this row.final booleanGet deleted status for this row.(package private) CallableLocatorProceduresReturns a reference to the locator procedures.(package private) final longgetLong(int column) private longgetLongFromDECIMAL(int column, String targetType) protected abstract void(package private) final ObjectgetObject(int column) private CalendarInstantiate an instance of Calendar that can be re-used for getting Time, Timestamp, and Date values from this cursor.(package private) final RefgetRef(int column) (package private) final shortgetShort(int column) (package private) final StringgetString(int column) private StringgetStringFromDATE(int column) private StringgetStringFromTIME(int column) private StringgetStringFromTIMESTAMP(int column) private StringgetStringWithoutConvert(int position, int actualLength) (package private) final Timeprivate Timeprivate final TimegetTimeFromTIMESTAMP(int column, Calendar cal) (package private) final TimestampgetTimestamp(int column, Calendar cal) private final TimestampgetTIMESTAMP(int column, Calendar cal) private final TimestampgetTimestampFromDATE(int column, Calendar cal) private final TimestampgetTimestampFromTIME(int column, Calendar cal) private StringgetVARCHAR(int column) final voidprotected abstract intlocator(int column) Returns the locator for the specified LOB column, orLob.INVALID_LOCATORif the LOB was not sent as a locator.protected final voidprotected final voidbooleannext()Makes the next row the current row.voidfinal voidvoidsetAllRowsReceivedFromServer(boolean b) Set the value of value of allRowsReceivedFromServer_.final voidsetIsRowUpdated(boolean isRowUpdated) Keep track of updated status for this row.final voidsetIsUpdataDeleteHole(int row, boolean isRowNull) voidsetNumberOfColumns(int numberOfColumns) protected booleanstepNext(boolean allowServerFetch) Makes the next row the current row.
-
Field Details
-
agent_
-
STRING
public static final int STRING- See Also:
-
VARIABLE_STRING
public static final int VARIABLE_STRING- See Also:
-
VARIABLE_SHORT_STRING
public static final int VARIABLE_SHORT_STRING- See Also:
-
NULL_TERMINATED_STRING
public static final int NULL_TERMINATED_STRING- See Also:
-
BYTES
public static final int BYTES- See Also:
-
NULL_TERMINATED_BYTES
public static final int NULL_TERMINATED_BYTES- See Also:
-
UTF_16BE
-
UTF_8
-
ISO_8859_1
-
dataBuffer_
public byte[] dataBuffer_ -
dataBufferStream_
-
position_
public int position_ -
lastValidBytePosition_
public int lastValidBytePosition_ -
hasLobs_
public boolean hasLobs_ -
currentRowPosition_
protected int currentRowPosition_ -
nextRowPosition_
private int nextRowPosition_ -
columnDataPosition_
protected int[] columnDataPosition_ -
columnDataComputedLength_
protected int[] columnDataComputedLength_ -
allRowsReceivedFromServer_
private boolean allRowsReceivedFromServer_ -
rowsRead_
long rowsRead_ -
maxFieldSize_
int maxFieldSize_ -
columnDataPositionCache_
-
columnDataLengthCache_
-
columnDataIsNullCache_
-
isUpdateDeleteHoleCache_
-
isUpdateDeleteHole_
boolean isUpdateDeleteHole_ -
isRowUpdated_
private boolean isRowUpdated_ -
ROW_IS_NULL
-
ROW_IS_NOT_NULL
-
recyclableCalendar_
-
jdbcTypes_
public int[] jdbcTypes_ -
columns_
public int columns_ -
nullable_
public boolean[] nullable_ -
charset_
-
isNull_
public boolean[] isNull_ -
fdocaLength_
public int[] fdocaLength_ -
ccsid_
public int[] ccsid_ -
charBuffer_
private char[] charBuffer_
-
-
Constructor Details
-
Cursor
-
-
Method Details
-
setNumberOfColumns
public void setNumberOfColumns(int numberOfColumns) -
stepNext
Makes the next row the current row. Returns true if the current row position is a valid row position.- Parameters:
allowServerFetch- if false, don't fetch more data from the server even if more data is needed- Returns:
trueif current row position is valid- Throws:
SqlException- if an error occurs
-
next
Makes the next row the current row. Returns true if the current row position is a valid row position.- Returns:
trueif current row position is valid- Throws:
SqlException- if an error occurs
-
setAllRowsReceivedFromServer
public void setAllRowsReceivedFromServer(boolean b) Set the value of value of allRowsReceivedFromServer_.- Parameters:
b- abooleanvalue indicating whether all rows are received from the server
-
allRowsReceivedFromServer
public final boolean allRowsReceivedFromServer()Returntrueif all rows are received from the server.- Returns:
trueif all rows are received from the server.
-
currentRowPositionIsEqualToNextRowPosition
final boolean currentRowPositionIsEqualToNextRowPosition() -
resetDataBuffer
public final void resetDataBuffer() -
dataBufferHasUnprocessedData
final boolean dataBufferHasUnprocessedData() -
calculateColumnOffsetsForRow_
protected abstract boolean calculateColumnOffsetsForRow_(int row, boolean allowServerFetch) throws SqlException, DisconnectException Calculate the column offsets for a row.- Parameters:
row- row indexallowServerFetch- if true, allow fetching more data from server- Returns:
trueif the current row position is a valid row position.- Throws:
SqlExceptionDisconnectException
-
clearLobData_
protected abstract void clearLobData_() -
getMoreData_
- Throws:
SqlException
-
setIsUpdataDeleteHole
public final void setIsUpdataDeleteHole(int row, boolean isRowNull) -
setIsRowUpdated
public final void setIsRowUpdated(boolean isRowUpdated) Keep track of updated status for this row.- Parameters:
isRowUpdated- true if row has been updated- See Also:
-
getIsRowUpdated
public final boolean getIsRowUpdated()Get updated status for this row. Minion of ResultSet#rowUpdated.- See Also:
-
getIsUpdateDeleteHole
public final boolean getIsUpdateDeleteHole()Get deleted status for this row. Minion of ResultSet#rowDeleted.- See Also:
-
markNextRowPosition
protected final void markNextRowPosition() -
makeNextRowPositionCurrent
protected final void makeNextRowPositionCurrent() -
incrementRowsReadEvent
public final void incrementRowsReadEvent() -
get_BOOLEAN
private boolean get_BOOLEAN(int column) -
get_SMALLINT
private final short get_SMALLINT(int column) -
get_INTEGER
protected final int get_INTEGER(int column) -
get_BIGINT
private final long get_BIGINT(int column) -
get_FLOAT
private final float get_FLOAT(int column) -
get_DOUBLE
private final double get_DOUBLE(int column) -
get_DECIMAL
- Throws:
SqlException
-
getDoubleFromDECIMAL
- Throws:
SqlException
-
getLongFromDECIMAL
- Throws:
SqlException
-
getVARCHAR
- Throws:
SqlException
-
getCHAR
- Throws:
SqlException
-
getDATE
- Throws:
SqlException
-
getTIME
- Throws:
SqlException
-
getTIMESTAMP
- Throws:
SqlException
-
getTimestampFromDATE
- Throws:
SqlException
-
getTimestampFromTIME
- Throws:
SqlException
-
getDateFromTIMESTAMP
- Throws:
SqlException
-
getTimeFromTIMESTAMP
- Throws:
SqlException
-
getStringFromDATE
- Throws:
SqlException
-
getStringFromTIME
- Throws:
SqlException
-
getStringFromTIMESTAMP
- Throws:
SqlException
-
get_CHAR_FOR_BIT_DATA
- Throws:
SqlException
-
get_VARCHAR_FOR_BIT_DATA
- Throws:
SqlException
-
get_UDT
- Throws:
SqlException
-
getRecyclableCalendar
Instantiate an instance of Calendar that can be re-used for getting Time, Timestamp, and Date values from this cursor. Assumption is that all users of the returned Calendar object will clear it as appropriate before using it. -
getLocatorProcedures
CallableLocatorProcedures getLocatorProcedures()Returns a reference to the locator procedures.These procedures are used to operate on large objects referenced on the server by locators.
- Returns:
- The locator procedures object.
-
locator
protected abstract int locator(int column) Returns the locator for the specified LOB column, orLob.INVALID_LOCATORif the LOB was not sent as a locator. The server may send the LOB value instead of a locator if it is running an old version which doesn't support locators, or if the database it accesses is soft upgraded from a version that doesn't have the necessary stored procedures for locator support.Note that this method cannot be invoked on a LOB column that is NULL.
- Parameters:
column- 1-based column index- Returns:
- A positive integer locator if valid,
Lob.INVALID_LOCATORotherwise.
-
getBlobColumn_
public abstract ClientBlob getBlobColumn_(int column, Agent agent, boolean toBePublished) throws SqlException Returns aBlobobject.- Parameters:
column- 1-based column indexagent- associated agenttoBePublished- whether the Blob will be published to the user- Returns:
- A Blob object.
- Throws:
SqlException- if getting theBlobfails
-
getClobColumn_
public abstract ClientClob getClobColumn_(int column, Agent agent, boolean toBePublished) throws SqlException Returns aClobobject.- Parameters:
column- 1-based column indexagent- associated agenttoBePublished- whether the Clob will be published to the user- Returns:
- A
java.sql.Clobobject. - Throws:
SqlException- if getting theClobfails
-
getBoolean
- Throws:
SqlException
-
getByte
- Throws:
SqlException
-
getShort
- Throws:
SqlException
-
getInt
- Throws:
SqlException
-
getLong
- Throws:
SqlException
-
getFloat
- Throws:
SqlException
-
getDouble
- Throws:
SqlException
-
getBigDecimal
- Throws:
SqlException
-
getDate
- Throws:
SqlException
-
getTime
- Throws:
SqlException
-
getTimestamp
- Throws:
SqlException
-
getString
- Throws:
SqlException
-
getBytes
- Throws:
SqlException
-
getBinaryStream
- Throws:
SqlException
-
getAsciiStream
- Throws:
SqlException
-
getCharacterStream
- Throws:
SqlException
-
getBlob
- Throws:
SqlException
-
getClob
- Throws:
SqlException
-
getArray
- Throws:
SqlException
-
getRef
- Throws:
SqlException
-
getObject
- Throws:
SqlException
-
allocateCharBuffer
public final void allocateCharBuffer() -
getStringWithoutConvert
-
coercionError
-
nullDataForGC
public void nullDataForGC() -
getColumnPrecision
private int getColumnPrecision(int column) -
getColumnScale
private int getColumnScale(int column)
-