com.pivotal.gemfirexd.internal.client.net

## Class NetCursor

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

Direct Known Subclasses:
  NetSqldta

    public class NetCursor
    extends Cursor

### Nested Class Summary

### Nested classes/interfaces inherited from class com.pivotal.gemfirexd.internal.client.am.Cursor

`Cursor.ThreadContextObjectInputStream`

### Field Summary

### Fields inherited from class com.pivotal.gemfirexd.internal.client.am.Cursor

`agent_, ALLOW_THREADCONTEXT_CLASSLOADER, BYTES, ccsid_, charsetName_, columnDataComputedLength_, columnDataIsNullCache_, columnDataLengthCache_, columnDataPosition_, columnDataPositionCache_, columns_, currentRowPosition_, dataBuffer_, dataBufferStream_, DBCS_CLOB, fdocaLength_, hasLobs_, isNull_, isUpdateDeleteHole_, isUpdateDeleteHoleCache_, jdbcTypes_, lastValidBytePosition_, locatorProcs_, MBCS_CLOB, NULL_TERMINATED_BYTES, NULL_TERMINATED_STRING, nullable_, position_, ROW_IS_NOT_NULL, ROW_IS_NULL, SBCS_CLOB, STRING, VARIABLE_BYTES, VARIABLE_SHORT_BYTES, VARIABLE_SHORT_STRING, VARIABLE_STRING`

### Method Summary

Methods
`protected void` `allocateDataBuffer()`
`protected void` `allocateDataBuffer(int length)`
`protected boolean` `calculateColumnOffsetsForRow_(int rowIndex, boolean allowServerFetch)` Calculate the column offsets for a row.
`protected void` `clearLobData_()`
`protected byte[]` `findExtdtaData(int column)`
`Blob` `getBlobColumn_(int column, Agent agent, boolean toBePublished)` Returns a `Blob` object.
`byte[]` `getClobBytes_(int column, int[] dataOffset)`
`Clob` `getClobColumn_(int column, Agent agent, boolean toBePublished)` Returns a `Clob` object.
`protected String` `getColumnLabel(int column)`
`protected int` `getDecimalLength(int index)`
`protected void` `getMoreData_()`
`protected boolean` `isDataBufferNull()`
`protected int` `locator(int column)` Get locator for LOB of the designated column
`void` `nullDataForGC()`
`void` `setAllRowsReceivedFromServer(boolean b)` Set the value of value of allRowsReceivedFromServer_.

### Methods inherited from class com.pivotal.gemfirexd.internal.client.am.Cursor

`allocateCharBuffer, allRowsReceivedFromServer, currentRowPositionIsEqualToNextRowPosition, dataBufferHasUnprocessedData, get_INTEGER, getArray, getAsciiStream, getBinaryStream, getBlob, getCharacterStream, getClob, getDataBuffer, getDataBufferLength, getIsRowUpdated, getIsUpdateDeleteHole, getLastValidBytePosition, getObject, getRef, getUnicodeStream, incrementRowsReadEvent, makeNextRowPositionCurrent, markCurrentRowPosition, markNextRowPosition, next, resetDataBuffer, setBuffer, setIsRowUpdated, setIsUpdataDeleteHole, setNumberOfColumns, stepNext`

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

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

### Method Detail

#### calculateColumnOffsetsForRow_

    protected boolean calculateColumnOffsetsForRow_(int rowIndex,
                                        boolean allowServerFetch)
                                             throws SqlException,
                                                    DisconnectException

Calculate the column offsets for a row.

Pseudo-code:

1. parse thru the current row in dataBuffer computing column offsets
2. if (we hit the super.lastValidBytePosition, ie. encounter partial row)
   1. shift partial row bytes to beginning of dataBuffer (this.shiftPartialRowToBeginning())
   2. reset current row position (also done by this.shiftPartialRowToBeginning())
   3. send and recv continue-query into commBuffer (rs.flowContinueQuery())
   4. parse commBuffer up to QRYDTA (rs.flowContinueQuery())
   5. copy query data from reply's commBuffer to our dataBuffer (this.copyQrydta())

Specified by:
  `calculateColumnOffsetsForRow_` in class `Cursor`
Parameters:
  `rowIndex` - 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`

#### isDataBufferNull

    protected boolean isDataBufferNull()

#### allocateDataBuffer

    protected void allocateDataBuffer()

#### allocateDataBuffer

    protected void allocateDataBuffer(int length)

#### clearLobData_

    protected void clearLobData_()

Specified by:
  `clearLobData_` in class `Cursor`

#### findExtdtaData

    protected byte[] findExtdtaData(int column)

#### locator

    protected int locator(int column)

Get locator for LOB of the designated column

Note that this method cannot be invoked on a LOB column that is NULL.

Specified by:
  `locator` in class `Cursor`
Parameters:
  `column` - column number, starts at 1
Returns:
  locator value, `Lob.INVALID_LOCATOR` if LOB value was sent instead of locator

#### getColumnLabel

    protected final String getColumnLabel(int column)
                                   throws SqlException

Specified by:
  `getColumnLabel` in class `Cursor`
Throws:
  `SqlException`

#### getBlobColumn_

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

Description copied from class: `Cursor`
Returns a `Blob` object.

Specified by:
  `getBlobColumn_` in class `Cursor`
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
See Also:
  `Cursor.getBlobColumn_(int, com.pivotal.gemfirexd.internal.client.am.Agent, boolean)`

#### getClobColumn_

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

Description copied from class: `Cursor`
Returns a `Clob` object.

Specified by:
  `getClobColumn_` in class `Cursor`
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
See Also:
  `Cursor.getClobColumn_(int, com.pivotal.gemfirexd.internal.client.am.Agent, boolean)`

#### getClobBytes_

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

Specified by:
  `getClobBytes_` in class `Cursor`
Throws:
  `SqlException`

#### getMoreData_

    protected void getMoreData_()
                         throws SqlException

Specified by:
  `getMoreData_` in class `Cursor`
Throws:
  `SqlException`

#### nullDataForGC

    public void nullDataForGC()

Overrides:
  `nullDataForGC` in class `Cursor`

#### getDecimalLength

    protected int getDecimalLength(int index)

#### setAllRowsReceivedFromServer

    public final void setAllRowsReceivedFromServer(boolean b)

Set the value of value of allRowsReceivedFromServer_.

Overrides:
  `setAllRowsReceivedFromServer` in class `Cursor`
Parameters:
  `b` - a `boolean` value indicating whether all rows are received from the server