com.pivotal.gemfirexd.internal.client.am

## Class Cursor

- java.lang.Object
- - com.pivotal.gemfirexd.internal.client.am.Cursor

Direct Known Subclasses:
  NetCursor

    public abstract class Cursor
    extends Object

### Nested Class Summary

Nested Classes
`static class` `Cursor.ThreadContextObjectInputStream` allow using Thread context ClassLoader to load classes

### Field Summary

Fields
`protected Agent` `agent_`
`static ThreadLocal` `ALLOW_THREADCONTEXT_CLASSLOADER`
`static int` `BYTES`
`int[]` `ccsid_`
`String[]` `charsetName_`
`protected int[]` `columnDataComputedLength_`
`protected ArrayList` `columnDataIsNullCache_`
`protected ArrayList` `columnDataLengthCache_`
`protected int[]` `columnDataPosition_`
`protected ArrayList` `columnDataPositionCache_`
`int` `columns_`
`protected int` `currentRowPosition_`
`byte[]` `dataBuffer_`
`ByteArrayOutputStream` `dataBufferStream_`
`static int` `DBCS_CLOB`
`int[]` `fdocaLength_`
`boolean` `hasLobs_`
`boolean[]` `isNull_`
`boolean` `isUpdateDeleteHole_`
`ArrayList` `isUpdateDeleteHoleCache_`
`int[]` `jdbcTypes_`
`int` `lastValidBytePosition_`
`protected CallableLocatorProcedures` `locatorProcs_`
`static int` `MBCS_CLOB`
`static int` `NULL_TERMINATED_BYTES`
`static int` `NULL_TERMINATED_STRING`
`boolean[]` `nullable_`
`int` `position_`
`static Boolean` `ROW_IS_NOT_NULL`
`static Boolean` `ROW_IS_NULL`
`static int` `SBCS_CLOB`
`static int` `STRING`
`static int` `VARIABLE_BYTES`
`static int` `VARIABLE_SHORT_BYTES`
`static int` `VARIABLE_SHORT_STRING`
`static int` `VARIABLE_STRING`

### Constructor Summary

Constructors
Constructor and Description
`Cursor(Agent agent)`
`Cursor(Agent agent, byte[] dataBuffer)`

### Method Summary

Methods
`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_()`
`boolean` `currentRowPositionIsEqualToNextRowPosition()`
`boolean` `dataBufferHasUnprocessedData()`
`protected int` `get_INTEGER(int column)`
`Array` `getArray(int column)`
`InputStream` `getAsciiStream(int column)`
`InputStream` `getBinaryStream(int column)`
`Blob` `getBlob(int column)`
`abstract Blob` `getBlobColumn_(int column, Agent agent, boolean toBePublished)` Returns a `Blob` object.
`Reader` `getCharacterStream(int column)`
`Clob` `getClob(int column)`
`abstract byte[]` `getClobBytes_(int column, int[] dataOffset)`
`abstract Clob` `getClobColumn_(int column, Agent agent, boolean toBePublished)` Returns a `Clob` object.
`protected abstract String` `getColumnLabel(int column)`
`byte[]` `getDataBuffer()`
`int` `getDataBufferLength()`
`boolean` `getIsRowUpdated()` Get updated status for this row.
`boolean` `getIsUpdateDeleteHole()` Get deleted status for this row.
`int` `getLastValidBytePosition()`
`protected abstract void` `getMoreData_()`
`Object` `getObject(int column)`
`Ref` `getRef(int column)`
`InputStream` `getUnicodeStream(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.
`void` `makeNextRowPositionCurrent()`
`void` `markCurrentRowPosition()`
`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` `setBuffer(byte[] dataBuffer)`
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### agent_

    protected Agent agent_

#### STRING

    public static final int STRING

See Also:
  Constant Field Values

#### VARIABLE_STRING

    public static final int VARIABLE_STRING

See Also:
  Constant Field Values

#### VARIABLE_SHORT_STRING

    public static final int VARIABLE_SHORT_STRING

See Also:
  Constant Field Values

#### NULL_TERMINATED_STRING

    public static final int NULL_TERMINATED_STRING

See Also:
  Constant Field Values

#### BYTES

    public static final int BYTES

See Also:
  Constant Field Values

#### VARIABLE_BYTES

    public static final int VARIABLE_BYTES

See Also:
  Constant Field Values

#### VARIABLE_SHORT_BYTES

    public static final int VARIABLE_SHORT_BYTES

See Also:
  Constant Field Values

#### NULL_TERMINATED_BYTES

    public static final int NULL_TERMINATED_BYTES

See Also:
  Constant Field Values

#### SBCS_CLOB

    public static final int SBCS_CLOB

See Also:
  Constant Field Values

#### MBCS_CLOB

    public static final int MBCS_CLOB

See Also:
  Constant Field Values

#### DBCS_CLOB

    public static final int DBCS_CLOB

See Also:
  Constant Field Values

#### dataBuffer_

    public byte[] dataBuffer_

#### dataBufferStream_

    public ByteArrayOutputStream dataBufferStream_

#### position_

    public int position_

#### lastValidBytePosition_

    public int lastValidBytePosition_

#### hasLobs_

    public boolean hasLobs_

#### currentRowPosition_

    protected int currentRowPosition_

#### columnDataPosition_

    protected int[] columnDataPosition_

#### columnDataComputedLength_

    protected int[] columnDataComputedLength_

#### columnDataPositionCache_

    protected ArrayList columnDataPositionCache_

#### columnDataLengthCache_

    protected ArrayList columnDataLengthCache_

#### columnDataIsNullCache_

    protected ArrayList columnDataIsNullCache_

#### isUpdateDeleteHoleCache_

    public ArrayList isUpdateDeleteHoleCache_

#### isUpdateDeleteHole_

    public boolean isUpdateDeleteHole_

#### ROW_IS_NULL

    public static final Boolean ROW_IS_NULL

#### ROW_IS_NOT_NULL

    public static final Boolean ROW_IS_NOT_NULL

#### jdbcTypes_

    public int[] jdbcTypes_

#### columns_

    public int columns_

#### nullable_

    public boolean[] nullable_

#### charsetName_

    public String[] charsetName_

#### isNull_

    public boolean[] isNull_

#### fdocaLength_

    public int[] fdocaLength_

#### ccsid_

    public int[] ccsid_

#### locatorProcs_

    protected final CallableLocatorProcedures locatorProcs_

#### ALLOW_THREADCONTEXT_CLASSLOADER

    public static final ThreadLocal ALLOW_THREADCONTEXT_CLASSLOADER

### Constructor Detail

#### Cursor

    public Cursor(Agent agent)

#### Cursor

    public Cursor(Agent agent,
          byte[] dataBuffer)

### Method Detail

#### setNumberOfColumns

    public void setNumberOfColumns(int numberOfColumns)

#### stepNext

    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` - if false, don't fetch more data from the server even if more data is needed
Returns:
  `true` if current row position is valid
Throws:
  `SqlException` - if an error occurs

#### next

    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:
  `true` if 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` - a `boolean` value indicating whether all rows are received from the server

#### allRowsReceivedFromServer

    public final boolean allRowsReceivedFromServer()

Return `true` if all rows are received from the server.

Returns:
  `true` if all rows are received from the server.

#### currentRowPositionIsEqualToNextRowPosition

    public final boolean currentRowPositionIsEqualToNextRowPosition()

#### resetDataBuffer

    public final void resetDataBuffer()

#### dataBufferHasUnprocessedData

    public 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 index
  `allowServerFetch` - if true, allow fetching more data from server
Returns:
  `true` if the current row position is a valid row position.
Throws:
  `SqlException`
  `DisconnectException`

#### clearLobData_

    protected abstract void clearLobData_()

#### getMoreData_

    protected abstract void getMoreData_()
                                  throws SqlException

Throws:
  `SqlException`

#### setBuffer

    public final void setBuffer(byte[] dataBuffer)

#### 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()`

#### getIsRowUpdated

    public final boolean getIsRowUpdated()

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

See Also:
  `setIsRowUpdated(boolean)`

#### getIsUpdateDeleteHole

    public final boolean getIsUpdateDeleteHole()

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

See Also:
  `setIsUpdataDeleteHole(int, boolean)`

#### markCurrentRowPosition

    public final void markCurrentRowPosition()

#### markNextRowPosition

    public final void markNextRowPosition()

#### makeNextRowPositionCurrent

    public final void makeNextRowPositionCurrent()

#### getDataBuffer

    public final byte[] getDataBuffer()

#### getDataBufferLength

    public final int getDataBufferLength()

#### getLastValidBytePosition

    public final int getLastValidBytePosition()

#### incrementRowsReadEvent

    public final void incrementRowsReadEvent()

#### get_INTEGER

    protected final int get_INTEGER(int column)

#### getColumnLabel

    protected abstract String getColumnLabel(int column)
                                      throws SqlException

Throws:
  `SqlException`

#### locator

    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` - 1-based column index
Returns:
  A positive integer locator if valid, `Lob.INVALID_LOCATOR` otherwise.

#### getBlobColumn_

    public abstract Blob getBlobColumn_(int column,
                      Agent agent,
                      boolean toBePublished)
                                 throws SqlException

Returns a `Blob` object.

Parameters:
  `column` - 1-based column index
  `agent` - associated agent
  `toBePublished` - whether the Blob will be published to the user
Returns:
  A Blob object.
Throws:
  `SqlException` - if getting the `Blob` fails

#### getClobColumn_

    public abstract Clob getClobColumn_(int column,
                      Agent agent,
                      boolean toBePublished)
                                 throws SqlException

Returns a `Clob` object.

Parameters:
  `column` - 1-based column index
  `agent` - associated agent
  `toBePublished` - whether the Clob will be published to the user
Returns:
  A Clob object.
Throws:
  `SqlException` - if getting the `Clob` fails

#### getClobBytes_

    public abstract byte[] getClobBytes_(int column,
                       int[] dataOffset)
                                  throws SqlException

Throws:
  `SqlException`

#### getBinaryStream

    public final InputStream getBinaryStream(int column)
                                      throws SqlException

Throws:
  `SqlException`

#### getAsciiStream

    public final InputStream getAsciiStream(int column)
                                     throws SqlException

Throws:
  `SqlException`

#### getUnicodeStream

    public final InputStream getUnicodeStream(int column)
                                       throws SqlException

Throws:
  `SqlException`

#### getCharacterStream

    public final Reader getCharacterStream(int column)
                                    throws SqlException

Throws:
  `SqlException`

#### getBlob

    public final Blob getBlob(int column)
                       throws SqlException

Throws:
  `SqlException`

#### getClob

    public final Clob getClob(int column)
                       throws SqlException

Throws:
  `SqlException`

#### getArray

    public final Array getArray(int column)
                         throws SqlException

Throws:
  `SqlException`

#### getRef

    public final Ref getRef(int column)
                     throws SqlException

Throws:
  `SqlException`

#### getObject

    public final Object getObject(int column)
                           throws SqlException

Throws:
  `SqlException`

#### allocateCharBuffer

    public final void allocateCharBuffer()

#### nullDataForGC

    public void nullDataForGC()