Top Fields Constructors Methods
org.apache.derby.client.am

public abstract Class Cursor

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.derby.client.net.NetCursor
Imports
org.apache.derby.shared.common.reference.SQLState, java.sql.SQLException, .Array, .Blob, .Clob, .Date, .Ref, .Time, .Timestamp, .Types, java.io.BufferedInputStream, .BufferedReader, .ByteArrayInputStream, .ByteArrayOutputStream, .InputStream, .InputStreamReader, .ObjectInputStream, .Reader, .StringReader, java.math.BigDecimal, java.nio.charset.Charset, java.util.ArrayList, .Calendar, .GregorianCalendar

Field Summary

Modifier and TypeField and Description
protected Agent
private boolean
public static final int
public int[]
private char[]
public Charset[]
protected int[]
protected ArrayList<boolean[]>
protected ArrayList<int[]>
protected int[]
protected ArrayList<int[]>
public int
protected int
public byte[]
public ByteArrayOutputStream
public int[]
public boolean
public boolean[]
pack-priv static final Charset
private boolean
pack-priv boolean
pack-priv ArrayList<Boolean>
public int[]
public int
pack-priv int
private int
public static final int
public static final int
public boolean[]
public int
private Calendar
private static final Boolean
pack-priv static final Boolean
pack-priv long
public static final int
pack-priv static final Charset
pack-priv static final Charset
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
Cursor(Agent agent)

Method Summary

Modifier and TypeMethod and Description
public final void
public final boolean

Returns:

true if all rows are received from the server.
allRowsReceivedFromServer
()

Return true if all rows are received from the server.

protected abstract boolean

Returns:

true if the current row position is a valid row position.
calculateColumnOffsetsForRow_
(int
row index
row
,
boolean
if true, allow fetching more data from server
allowServerFetch
)

Calculate the column offsets for a row.

protected abstract void
private ColumnTypeConversionException
coercionError(String targetType, int sourceColumn)

pack-priv final boolean
pack-priv final boolean
private final long
get_BIGINT(int column)

private boolean
get_BOOLEAN(int column)

private byte[]
private final BigDecimal
get_DECIMAL(int column)

private final double
get_DOUBLE(int column)

private final float
get_FLOAT(int column)

protected final int
get_INTEGER(int column)

private final short
get_SMALLINT(int column)

private Object
get_UDT(int column)

private byte[]
pack-priv final Array
getArray(int column)

pack-priv final InputStream
getAsciiStream(int column)

pack-priv final BigDecimal
getBigDecimal(int column)

pack-priv final InputStream
getBinaryStream(int column)

pack-priv final Blob
getBlob(int column)

public abstract ClientBlob

Returns:

A Blob object.
getBlobColumn_
(int
1-based column index
column
,
Agent
associated agent
agent
,
boolean
whether the Blob will be published to the user
toBePublished
)

Returns a Blob object.

pack-priv final boolean
getBoolean(int column)

pack-priv final byte
getByte(int column)

pack-priv final byte[]
getBytes(int column)

private String
getCHAR(int column)

pack-priv final Reader
getCharacterStream(int column)

pack-priv final Clob
getClob(int column)

public abstract ClientClob

Returns:

A java.sql.Clob object.
getClobColumn_
(int
1-based column index
column
,
Agent
associated agent
agent
,
boolean
whether the Clob will be published to the user
toBePublished
)

Returns a Clob object.

private int
getColumnPrecision(int column)

private int
getColumnScale(int column)

private Date
getDATE(int column, Calendar cal)

pack-priv final Date
getDate(int column, Calendar cal)

private final Date
getDateFromTIMESTAMP(int column, Calendar cal)

pack-priv final double
getDouble(int column)

private double
pack-priv final float
getFloat(int column)

pack-priv final int
getInt(int column)

public final boolean

Returns:

true if this row was updated
getIsRowUpdated
()

Get updated status for this row.

public final boolean

Returns:

true if the row was deleted
getIsUpdateDeleteHole
()

Get deleted status for this row.

pack-priv CallableLocatorProcedures

Returns:

The locator procedures object.
getLocatorProcedures
()

Returns a reference to the locator procedures.

pack-priv final long
getLong(int column)

private long
getLongFromDECIMAL(int column, String targetType)

protected abstract void
pack-priv final Object
getObject(int column)

private Calendar
getRecyclableCalendar()

Instantiate an instance of Calendar that can be re-used for getting Time, Timestamp, and Date values from this cursor.

pack-priv final Ref
getRef(int column)

pack-priv final short
getShort(int column)

pack-priv final String
getString(int column)

private String
getStringFromDATE(int column)

private String
getStringFromTIME(int column)

private String
private String
getStringWithoutConvert(int position, int actualLength)

private Time
getTIME(int column, Calendar cal)

pack-priv final Time
getTime(int column, Calendar cal)

private final Time
getTimeFromTIMESTAMP(int column, Calendar cal)

private final Timestamp
getTIMESTAMP(int column, Calendar cal)

pack-priv final Timestamp
getTimestamp(int column, Calendar cal)

private final Timestamp
getTimestampFromDATE(int column, Calendar cal)

private final Timestamp
getTimestampFromTIME(int column, Calendar cal)

private String
getVARCHAR(int column)

public final void
protected abstract int

Returns:

A positive integer locator if valid, Lob#INVALID_LOCATOR otherwise.
locator
(int
1-based column index
column
)

Returns the locator for the specified LOB column, or Lob#INVALID_LOCATOR if the LOB was not sent as a locator.

protected final void
protected final void
public boolean

Returns:

true if current row position is valid
next
()

Makes the next row the current row.

public void
public final void
public void
setAllRowsReceivedFromServer(boolean
a boolean value indicating whether all rows are received from the server
b
)

Set the value of value of allRowsReceivedFromServer_.

public final void
setIsRowUpdated(boolean
true if row has been updated
isRowUpdated
)

Keep track of updated status for this row.

public final void
setIsUpdataDeleteHole(int row, boolean isRowNull)

public void
setNumberOfColumns(int numberOfColumns)

protected boolean

Returns:

true if current row position is valid
stepNext
(boolean
if false, don't fetch more data from the server even if more data is needed
allowServerFetch
)

Makes the next row the current row.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

agent_back to summary
protected Agent agent_
allRowsReceivedFromServer_back to summary
private boolean allRowsReceivedFromServer_
BYTESback to summary
public static final int BYTES
ccsid_back to summary
public int[] ccsid_
charBuffer_back to summary
private char[] charBuffer_
charset_back to summary
public Charset[] charset_
columnDataComputedLength_back to summary
protected int[] columnDataComputedLength_
columnDataIsNullCache_back to summary
protected ArrayList<boolean[]> columnDataIsNullCache_
columnDataLengthCache_back to summary
protected ArrayList<int[]> columnDataLengthCache_
columnDataPosition_back to summary
protected int[] columnDataPosition_
columnDataPositionCache_back to summary
protected ArrayList<int[]> columnDataPositionCache_
columns_back to summary
public int columns_
currentRowPosition_back to summary
protected int currentRowPosition_
dataBuffer_back to summary
public byte[] dataBuffer_
dataBufferStream_back to summary
public ByteArrayOutputStream dataBufferStream_
fdocaLength_back to summary
public int[] fdocaLength_
hasLobs_back to summary
public boolean hasLobs_
isNull_back to summary
public boolean[] isNull_
ISO_8859_1back to summary
pack-priv static final Charset ISO_8859_1
isRowUpdated_back to summary
private boolean isRowUpdated_
isUpdateDeleteHole_back to summary
pack-priv boolean isUpdateDeleteHole_
isUpdateDeleteHoleCache_back to summary
pack-priv ArrayList<Boolean> isUpdateDeleteHoleCache_
jdbcTypes_back to summary
public int[] jdbcTypes_
lastValidBytePosition_back to summary
public int lastValidBytePosition_
maxFieldSize_back to summary
pack-priv int maxFieldSize_
nextRowPosition_back to summary
private int nextRowPosition_
NULL_TERMINATED_BYTESback to summary
public static final int NULL_TERMINATED_BYTES
NULL_TERMINATED_STRINGback to summary
public static final int NULL_TERMINATED_STRING
nullable_back to summary
public boolean[] nullable_
position_back to summary
public int position_
recyclableCalendar_back to summary
private Calendar recyclableCalendar_
ROW_IS_NOT_NULLback to summary
private static final Boolean ROW_IS_NOT_NULL
ROW_IS_NULLback to summary
pack-priv static final Boolean ROW_IS_NULL
rowsRead_back to summary
pack-priv long rowsRead_
STRINGback to summary
public static final int STRING
UTF_16BEback to summary
pack-priv static final Charset UTF_16BE
UTF_8back to summary
pack-priv static final Charset UTF_8
VARIABLE_SHORT_STRINGback to summary
public static final int VARIABLE_SHORT_STRING
VARIABLE_STRINGback to summary
public static final int VARIABLE_STRING

Constructor Detail

Cursorback to summary
public Cursor(Agent agent)

Method Detail

allocateCharBufferback to summary
public final void allocateCharBuffer()
allRowsReceivedFromServerback to summary
public final boolean allRowsReceivedFromServer()

Return true if all rows are received from the server.

Returns:boolean

true if all rows are received from the server.

calculateColumnOffsetsForRow_back to summary
protected abstract boolean calculateColumnOffsetsForRow_(int row, boolean allowServerFetch) throws SqlException, DisconnectException

Calculate the column offsets for a row.

Parameters
row:int

row index

allowServerFetch:boolean

if true, allow fetching more data from server

Returns:boolean

true if the current row position is a valid row position.

Exceptions
SqlException:
on error
DisconnectException:
on error
clearLobData_back to summary
protected abstract void clearLobData_()
coercionErrorback to summary
private ColumnTypeConversionException coercionError(String targetType, int sourceColumn)
currentRowPositionIsEqualToNextRowPositionback to summary
pack-priv final boolean currentRowPositionIsEqualToNextRowPosition()
dataBufferHasUnprocessedDataback to summary
pack-priv final boolean dataBufferHasUnprocessedData()
get_BIGINTback to summary
private final long get_BIGINT(int column)
get_BOOLEANback to summary
private boolean get_BOOLEAN(int column)
get_CHAR_FOR_BIT_DATAback to summary
private byte[] get_CHAR_FOR_BIT_DATA(int column) throws SqlException
get_DECIMALback to summary
private final BigDecimal get_DECIMAL(int column) throws SqlException
get_DOUBLEback to summary
private final double get_DOUBLE(int column)
get_FLOATback to summary
private final float get_FLOAT(int column)
get_INTEGERback to summary
protected final int get_INTEGER(int column)
get_SMALLINTback to summary
private final short get_SMALLINT(int column)
get_UDTback to summary
private Object get_UDT(int column) throws SqlException
get_VARCHAR_FOR_BIT_DATAback to summary
private byte[] get_VARCHAR_FOR_BIT_DATA(int column) throws SqlException
getArrayback to summary
pack-priv final Array getArray(int column) throws SqlException
getAsciiStreamback to summary
pack-priv final InputStream getAsciiStream(int column) throws SqlException
getBigDecimalback to summary
pack-priv final BigDecimal getBigDecimal(int column) throws SqlException
getBinaryStreamback to summary
pack-priv final InputStream getBinaryStream(int column) throws SqlException
getBlobback to summary
pack-priv final Blob getBlob(int column) throws SqlException
getBlobColumn_back to summary
public abstract ClientBlob getBlobColumn_(int column, Agent agent, boolean toBePublished) throws SqlException

Returns a Blob object.

Parameters
column:int

1-based column index

agent:Agent

associated agent

toBePublished:boolean

whether the Blob will be published to the user

Returns:ClientBlob

A Blob object.

Exceptions
SqlException:
if getting the Blob fails
getBooleanback to summary
pack-priv final boolean getBoolean(int column) throws SqlException
getByteback to summary
pack-priv final byte getByte(int column) throws SqlException
getBytesback to summary
pack-priv final byte[] getBytes(int column) throws SqlException
getCHARback to summary
private String getCHAR(int column) throws SqlException
getCharacterStreamback to summary
pack-priv final Reader getCharacterStream(int column) throws SqlException
getClobback to summary
pack-priv final Clob getClob(int column) throws SqlException
getClobColumn_back to summary
public abstract ClientClob getClobColumn_(int column, Agent agent, boolean toBePublished) throws SqlException

Returns a Clob object.

Parameters
column:int

1-based column index

agent:Agent

associated agent

toBePublished:boolean

whether the Clob will be published to the user

Returns:ClientClob

A java.sql.Clob object.

Exceptions
SqlException:
if getting the Clob fails
getColumnPrecisionback to summary
private int getColumnPrecision(int column)
getColumnScaleback to summary
private int getColumnScale(int column)
getDATEback to summary
private Date getDATE(int column, Calendar cal) throws SqlException
getDateback to summary
pack-priv final Date getDate(int column, Calendar cal) throws SqlException
getDateFromTIMESTAMPback to summary
private final Date getDateFromTIMESTAMP(int column, Calendar cal) throws SqlException
getDoubleback to summary
pack-priv final double getDouble(int column) throws SqlException
getDoubleFromDECIMALback to summary
private double getDoubleFromDECIMAL(int column) throws SqlException
getFloatback to summary
pack-priv final float getFloat(int column) throws SqlException
getIntback to summary
pack-priv final int getInt(int column) throws SqlException
getIsRowUpdatedback to summary
public final boolean getIsRowUpdated()

Get updated status for this row. Minion of ResultSet#rowUpdated.

Returns:boolean

true if this row was updated

See Also
Cursor#setIsRowUpdated
getIsUpdateDeleteHoleback to summary
public final boolean getIsUpdateDeleteHole()

Get deleted status for this row. Minion of ResultSet#rowDeleted.

Returns:boolean

true if the row was deleted

See Also
Cursor#setIsUpdataDeleteHole
getLocatorProceduresback to summary
pack-priv 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:CallableLocatorProcedures

The locator procedures object.

getLongback to summary
pack-priv final long getLong(int column) throws SqlException
getLongFromDECIMALback to summary
private long getLongFromDECIMAL(int column, String targetType) throws SqlException
getMoreData_back to summary
protected abstract void getMoreData_() throws SqlException
getObjectback to summary
pack-priv final Object getObject(int column) throws SqlException
getRecyclableCalendarback to summary
private Calendar 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.

getRefback to summary
pack-priv final Ref getRef(int column) throws SqlException
getShortback to summary
pack-priv final short getShort(int column) throws SqlException
getStringback to summary
pack-priv final String getString(int column) throws SqlException
getStringFromDATEback to summary
private String getStringFromDATE(int column) throws SqlException
getStringFromTIMEback to summary
private String getStringFromTIME(int column) throws SqlException
getStringFromTIMESTAMPback to summary
private String getStringFromTIMESTAMP(int column) throws SqlException
getStringWithoutConvertback to summary
private String getStringWithoutConvert(int position, int actualLength)
getTIMEback to summary
private Time getTIME(int column, Calendar cal) throws SqlException
getTimeback to summary
pack-priv final Time getTime(int column, Calendar cal) throws SqlException
getTimeFromTIMESTAMPback to summary
private final Time getTimeFromTIMESTAMP(int column, Calendar cal) throws SqlException
getTIMESTAMPback to summary
private final Timestamp getTIMESTAMP(int column, Calendar cal) throws SqlException
getTimestampback to summary
pack-priv final Timestamp getTimestamp(int column, Calendar cal) throws SqlException
getTimestampFromDATEback to summary
private final Timestamp getTimestampFromDATE(int column, Calendar cal) throws SqlException
getTimestampFromTIMEback to summary
private final Timestamp getTimestampFromTIME(int column, Calendar cal) throws SqlException
getVARCHARback to summary
private String getVARCHAR(int column) throws SqlException
incrementRowsReadEventback to summary
public final void incrementRowsReadEvent()
locatorback to summary
protected abstract int locator(int column)

Returns the locator for the specified LOB column, or Lob#INVALID_LOCATOR if 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:int

1-based column index

Returns:int

A positive integer locator if valid, Lob#INVALID_LOCATOR otherwise.

makeNextRowPositionCurrentback to summary
protected final void makeNextRowPositionCurrent()
markNextRowPositionback to summary
protected final void markNextRowPosition()
nextback to summary
public boolean next() throws SqlException

Makes the next row the current row. Returns true if the current row position is a valid row position.

Returns:boolean

true if current row position is valid

Exceptions
SqlException:
if an error occurs
nullDataForGCback to summary
public void nullDataForGC()
resetDataBufferback to summary
public final void resetDataBuffer()
setAllRowsReceivedFromServerback to summary
public void setAllRowsReceivedFromServer(boolean b)

Set the value of value of allRowsReceivedFromServer_.

Parameters
b:boolean

a boolean value indicating whether all rows are received from the server

setIsRowUpdatedback to summary
public final void setIsRowUpdated(boolean isRowUpdated)

Keep track of updated status for this row.

Parameters
isRowUpdated:boolean

true if row has been updated

See Also
Cursor#getIsRowUpdated
setIsUpdataDeleteHoleback to summary
public final void setIsUpdataDeleteHole(int row, boolean isRowNull)
setNumberOfColumnsback to summary
public void setNumberOfColumns(int numberOfColumns)
stepNextback to summary
protected boolean stepNext(boolean allowServerFetch) throws SqlException

Makes the next row the current row. Returns true if the current row position is a valid row position.

Parameters
allowServerFetch:boolean

if false, don't fetch more data from the server even if more data is needed

Returns:boolean

true if current row position is valid

Exceptions
SqlException:
if an error occurs