public abstract class Cursor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Agent |
agent_ |
private boolean |
allRowsReceivedFromServer_ |
static int |
BYTES |
int[] |
ccsid_ |
private char[] |
charBuffer_ |
java.nio.charset.Charset[] |
charset_ |
protected int[] |
columnDataComputedLength_ |
protected java.util.ArrayList<boolean[]> |
columnDataIsNullCache_ |
protected java.util.ArrayList<int[]> |
columnDataLengthCache_ |
protected int[] |
columnDataPosition_ |
protected java.util.ArrayList<int[]> |
columnDataPositionCache_ |
int |
columns_ |
protected int |
currentRowPosition_ |
byte[] |
dataBuffer_ |
java.io.ByteArrayOutputStream |
dataBufferStream_ |
int[] |
fdocaLength_ |
boolean |
hasLobs_ |
boolean[] |
isNull_ |
(package private) static java.nio.charset.Charset |
ISO_8859_1 |
private boolean |
isRowUpdated_ |
(package private) boolean |
isUpdateDeleteHole_ |
(package private) java.util.ArrayList<java.lang.Boolean> |
isUpdateDeleteHoleCache_ |
int[] |
jdbcTypes_ |
int |
lastValidBytePosition_ |
(package private) int |
maxFieldSize_ |
private int |
nextRowPosition_ |
static int |
NULL_TERMINATED_BYTES |
static int |
NULL_TERMINATED_STRING |
boolean[] |
nullable_ |
int |
position_ |
private java.util.Calendar |
recyclableCalendar_ |
private static java.lang.Boolean |
ROW_IS_NOT_NULL |
(package private) static java.lang.Boolean |
ROW_IS_NULL |
(package private) long |
rowsRead_ |
static int |
STRING |
(package private) static java.nio.charset.Charset |
UTF_16BE |
(package private) static java.nio.charset.Charset |
UTF_8 |
static int |
VARIABLE_SHORT_STRING |
static int |
VARIABLE_STRING |
Modifier and Type | Method and Description |
---|---|
void |
allocateCharBuffer() |
boolean |
allRowsReceivedFromServer()
Return
true if all rows are received from the
server. |
protected abstract boolean |
calculateColumnOffsetsForRow_(int row,
boolean allowServerFetch)
Calculate the column offsets for a row.
|
protected abstract void |
clearLobData_() |
private ColumnTypeConversionException |
coercionError(java.lang.String targetType,
int sourceColumn) |
(package private) boolean |
currentRowPositionIsEqualToNextRowPosition() |
(package private) boolean |
dataBufferHasUnprocessedData() |
private long |
get_BIGINT(int column) |
private boolean |
get_BOOLEAN(int column) |
private byte[] |
get_CHAR_FOR_BIT_DATA(int column) |
private java.math.BigDecimal |
get_DECIMAL(int column) |
private double |
get_DOUBLE(int column) |
private float |
get_FLOAT(int column) |
protected int |
get_INTEGER(int column) |
private short |
get_SMALLINT(int column) |
private java.lang.Object |
get_UDT(int column) |
private byte[] |
get_VARCHAR_FOR_BIT_DATA(int column) |
(package private) java.sql.Array |
getArray(int column) |
(package private) java.io.InputStream |
getAsciiStream(int column) |
(package private) java.math.BigDecimal |
getBigDecimal(int column) |
(package private) java.io.InputStream |
getBinaryStream(int column) |
(package private) java.sql.Blob |
getBlob(int column) |
abstract ClientBlob |
getBlobColumn_(int column,
Agent agent,
boolean toBePublished)
Returns a
Blob object. |
(package private) boolean |
getBoolean(int column) |
(package private) byte |
getByte(int column) |
(package private) byte[] |
getBytes(int column) |
private java.lang.String |
getCHAR(int column) |
(package private) java.io.Reader |
getCharacterStream(int column) |
(package private) java.sql.Clob |
getClob(int column) |
abstract ClientClob |
getClobColumn_(int column,
Agent agent,
boolean toBePublished)
Returns a
Clob object. |
private int |
getColumnPrecision(int column) |
private int |
getColumnScale(int column) |
(package private) java.sql.Date |
getDate(int column,
java.util.Calendar cal) |
private java.sql.Date |
getDATE(int column,
java.util.Calendar cal) |
private java.sql.Date |
getDateFromTIMESTAMP(int column,
java.util.Calendar cal) |
(package private) double |
getDouble(int column) |
private double |
getDoubleFromDECIMAL(int column) |
(package private) float |
getFloat(int column) |
(package private) int |
getInt(int column) |
boolean |
getIsRowUpdated()
Get updated status for this row.
|
boolean |
getIsUpdateDeleteHole()
Get deleted status for this row.
|
(package private) CallableLocatorProcedures |
getLocatorProcedures()
Returns a reference to the locator procedures.
|
(package private) long |
getLong(int column) |
private long |
getLongFromDECIMAL(int column,
java.lang.String targetType) |
protected abstract void |
getMoreData_() |
(package private) java.lang.Object |
getObject(int column) |
private java.util.Calendar |
getRecyclableCalendar()
Instantiate an instance of Calendar that can be re-used for getting
Time, Timestamp, and Date values from this cursor.
|
(package private) java.sql.Ref |
getRef(int column) |
(package private) short |
getShort(int column) |
(package private) java.lang.String |
getString(int column) |
private java.lang.String |
getStringFromDATE(int column) |
private java.lang.String |
getStringFromTIME(int column) |
private java.lang.String |
getStringFromTIMESTAMP(int column) |
private java.lang.String |
getStringWithoutConvert(int position,
int actualLength) |
(package private) java.sql.Time |
getTime(int column,
java.util.Calendar cal) |
private java.sql.Time |
getTIME(int column,
java.util.Calendar cal) |
private java.sql.Time |
getTimeFromTIMESTAMP(int column,
java.util.Calendar cal) |
(package private) java.sql.Timestamp |
getTimestamp(int column,
java.util.Calendar cal) |
private java.sql.Timestamp |
getTIMESTAMP(int column,
java.util.Calendar cal) |
private java.sql.Timestamp |
getTimestampFromDATE(int column,
java.util.Calendar cal) |
private java.sql.Timestamp |
getTimestampFromTIME(int column,
java.util.Calendar cal) |
private java.lang.String |
getVARCHAR(int column) |
void |
incrementRowsReadEvent() |
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. |
protected void |
makeNextRowPositionCurrent() |
protected void |
markNextRowPosition() |
boolean |
next()
Makes the next row the current row.
|
void |
nullDataForGC() |
void |
resetDataBuffer() |
void |
setAllRowsReceivedFromServer(boolean b)
Set the value of value of allRowsReceivedFromServer_.
|
void |
setIsRowUpdated(boolean isRowUpdated)
Keep track of updated status for this row.
|
void |
setIsUpdataDeleteHole(int row,
boolean isRowNull) |
void |
setNumberOfColumns(int numberOfColumns) |
protected boolean |
stepNext(boolean allowServerFetch)
Makes the next row the current row.
|
protected Agent agent_
public static final int STRING
public static final int VARIABLE_STRING
public static final int VARIABLE_SHORT_STRING
public static final int NULL_TERMINATED_STRING
public static final int BYTES
public static final int NULL_TERMINATED_BYTES
static final java.nio.charset.Charset UTF_16BE
static final java.nio.charset.Charset UTF_8
static final java.nio.charset.Charset ISO_8859_1
public byte[] dataBuffer_
public java.io.ByteArrayOutputStream dataBufferStream_
public int position_
public int lastValidBytePosition_
public boolean hasLobs_
protected int currentRowPosition_
private int nextRowPosition_
protected int[] columnDataPosition_
protected int[] columnDataComputedLength_
private boolean allRowsReceivedFromServer_
long rowsRead_
int maxFieldSize_
protected java.util.ArrayList<int[]> columnDataPositionCache_
protected java.util.ArrayList<int[]> columnDataLengthCache_
protected java.util.ArrayList<boolean[]> columnDataIsNullCache_
java.util.ArrayList<java.lang.Boolean> isUpdateDeleteHoleCache_
boolean isUpdateDeleteHole_
private boolean isRowUpdated_
static final java.lang.Boolean ROW_IS_NULL
private static final java.lang.Boolean ROW_IS_NOT_NULL
private java.util.Calendar recyclableCalendar_
public int[] jdbcTypes_
public int columns_
public boolean[] nullable_
public java.nio.charset.Charset[] charset_
public boolean[] isNull_
public int[] fdocaLength_
public int[] ccsid_
private char[] charBuffer_
public Cursor(Agent agent)
public void setNumberOfColumns(int numberOfColumns)
protected boolean stepNext(boolean allowServerFetch) throws SqlException
allowServerFetch
- if false, don't fetch more data from
the server even if more data is neededtrue
if current row position is validSqlException
- if an error occurspublic boolean next() throws SqlException
true
if current row position is validSqlException
- if an error occurspublic void setAllRowsReceivedFromServer(boolean b)
b
- a boolean
value indicating whether all
rows are received from the serverpublic final boolean allRowsReceivedFromServer()
true
if all rows are received from the
server.true
if all rows are received from the
server.final boolean currentRowPositionIsEqualToNextRowPosition()
public final void resetDataBuffer()
final boolean dataBufferHasUnprocessedData()
protected abstract boolean calculateColumnOffsetsForRow_(int row, boolean allowServerFetch) throws SqlException, DisconnectException
row
- row indexallowServerFetch
- if true, allow fetching more data from
servertrue
if the current row position is a
valid row position.SqlException
DisconnectException
protected abstract void clearLobData_()
protected abstract void getMoreData_() throws SqlException
SqlException
public final void setIsUpdataDeleteHole(int row, boolean isRowNull)
public final void setIsRowUpdated(boolean isRowUpdated)
isRowUpdated
- true if row has been updatedgetIsRowUpdated()
public final boolean getIsRowUpdated()
setIsRowUpdated(boolean)
public final boolean getIsUpdateDeleteHole()
setIsUpdataDeleteHole(int, boolean)
protected final void markNextRowPosition()
protected final void makeNextRowPositionCurrent()
public final void incrementRowsReadEvent()
private boolean get_BOOLEAN(int column)
private final short get_SMALLINT(int column)
protected final int get_INTEGER(int column)
private final long get_BIGINT(int column)
private final float get_FLOAT(int column)
private final double get_DOUBLE(int column)
private final java.math.BigDecimal get_DECIMAL(int column) throws SqlException
SqlException
private double getDoubleFromDECIMAL(int column) throws SqlException
SqlException
private long getLongFromDECIMAL(int column, java.lang.String targetType) throws SqlException
SqlException
private java.lang.String getVARCHAR(int column) throws SqlException
SqlException
private java.lang.String getCHAR(int column) throws SqlException
SqlException
private java.sql.Date getDATE(int column, java.util.Calendar cal) throws SqlException
SqlException
private java.sql.Time getTIME(int column, java.util.Calendar cal) throws SqlException
SqlException
private final java.sql.Timestamp getTIMESTAMP(int column, java.util.Calendar cal) throws SqlException
SqlException
private final java.sql.Timestamp getTimestampFromDATE(int column, java.util.Calendar cal) throws SqlException
SqlException
private final java.sql.Timestamp getTimestampFromTIME(int column, java.util.Calendar cal) throws SqlException
SqlException
private final java.sql.Date getDateFromTIMESTAMP(int column, java.util.Calendar cal) throws SqlException
SqlException
private final java.sql.Time getTimeFromTIMESTAMP(int column, java.util.Calendar cal) throws SqlException
SqlException
private java.lang.String getStringFromDATE(int column) throws SqlException
SqlException
private java.lang.String getStringFromTIME(int column) throws SqlException
SqlException
private java.lang.String getStringFromTIMESTAMP(int column) throws SqlException
SqlException
private byte[] get_CHAR_FOR_BIT_DATA(int column) throws SqlException
SqlException
private byte[] get_VARCHAR_FOR_BIT_DATA(int column) throws SqlException
SqlException
private java.lang.Object get_UDT(int column) throws SqlException
SqlException
private java.util.Calendar getRecyclableCalendar()
CallableLocatorProcedures getLocatorProcedures()
These procedures are used to operate on large objects referenced on the server by locators.
protected abstract int locator(int column)
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.
column
- 1-based column indexLob.INVALID_LOCATOR
otherwise.public abstract ClientBlob getBlobColumn_(int column, Agent agent, boolean toBePublished) throws SqlException
Blob
object.column
- 1-based column indexagent
- associated agenttoBePublished
- whether the Blob will be published to the userSqlException
- if getting the Blob
failspublic abstract ClientClob getClobColumn_(int column, Agent agent, boolean toBePublished) throws SqlException
Clob
object.column
- 1-based column indexagent
- associated agenttoBePublished
- whether the Clob will be published to the userjava.sql.Clob
object.SqlException
- if getting the Clob
failsfinal boolean getBoolean(int column) throws SqlException
SqlException
final byte getByte(int column) throws SqlException
SqlException
final short getShort(int column) throws SqlException
SqlException
final int getInt(int column) throws SqlException
SqlException
final long getLong(int column) throws SqlException
SqlException
final float getFloat(int column) throws SqlException
SqlException
final double getDouble(int column) throws SqlException
SqlException
final java.math.BigDecimal getBigDecimal(int column) throws SqlException
SqlException
final java.sql.Date getDate(int column, java.util.Calendar cal) throws SqlException
SqlException
final java.sql.Time getTime(int column, java.util.Calendar cal) throws SqlException
SqlException
final java.sql.Timestamp getTimestamp(int column, java.util.Calendar cal) throws SqlException
SqlException
final java.lang.String getString(int column) throws SqlException
SqlException
final byte[] getBytes(int column) throws SqlException
SqlException
final java.io.InputStream getBinaryStream(int column) throws SqlException
SqlException
final java.io.InputStream getAsciiStream(int column) throws SqlException
SqlException
final java.io.Reader getCharacterStream(int column) throws SqlException
SqlException
final java.sql.Blob getBlob(int column) throws SqlException
SqlException
final java.sql.Clob getClob(int column) throws SqlException
SqlException
final java.sql.Array getArray(int column) throws SqlException
SqlException
final java.sql.Ref getRef(int column) throws SqlException
SqlException
final java.lang.Object getObject(int column) throws SqlException
SqlException
public final void allocateCharBuffer()
private java.lang.String getStringWithoutConvert(int position, int actualLength)
private ColumnTypeConversionException coercionError(java.lang.String targetType, int sourceColumn)
public void nullDataForGC()
private int getColumnPrecision(int column)
private int getColumnScale(int column)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.