Package net.snowflake.client.core

## Class SFResultSet

- java.lang.Object
- - net.snowflake.client.core.SFBaseResultSet
  - - net.snowflake.client.core.SFJsonResultSet
    - - net.snowflake.client.core.SFResultSet

    public class SFResultSet
    extends SFJsonResultSet

Snowflake ResultSet implementation

Author:
  jhuang

### Field Summary

Fields
`protected SFBaseStatement` `statement`

### Fields inherited from class net.snowflake.client.core.SFJsonResultSet

`converters`

### Fields inherited from class net.snowflake.client.core.SFBaseResultSet

`isClosed, metaDataOfBinds, numberOfBinds, OBJECT_MAPPER, parameters, resultSetMetaData, resultSetSerializable, resultVersion, row, session, sessionTimeZone`

### Constructor Summary

Constructors
`SFResultSet​(SnowflakeResultSetSerializableV1 resultSetSerializable, SFBaseSession session, Telemetry telemetryClient, boolean sortResult)` This is a minimum initialization for SFResultSet.
`SFResultSet​(SnowflakeResultSetSerializableV1 resultSetSerializable, SFBaseStatement statement, boolean sortResult)` Constructor takes a result from the API response that we get from executing a SQL statement.
`SFResultSet​(SnowflakeResultSetSerializableV1 resultSetSerializable, Telemetry telemetryClient, boolean sortResult)` This is a minimum initialization for SFResultSet.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`protected Object` `getObjectInternal​(int columnIndex)` Given a column index, get current row's value as an object
`String` `getQueryId()`
`SFStatementType` `getStatementType()`
`boolean` `isAfterLast()`
`boolean` `isArrayBindSupported()`
`boolean` `isLast()`
`boolean` `next()` Advance to next row
`void` `setStatementType​(SFStatementType statementType)`

### Methods inherited from class net.snowflake.client.core.SFJsonResultSet

`convertToDate, convertToTime, convertToTimestamp, createSqlInputForColumn, getArray, getBigDecimal, getBigDecimal, getBoolean, getByte, getBytes, getConverters, getDate, getDate, getDouble, getFloat, getInt, getLong, getObject, getObjectWithoutString, getShort, getString, getTime, getTimestamp`

### Methods inherited from class net.snowflake.client.core.SFBaseResultSet

`absolute, convertStringToDate, convertStringToTime, convertStringToTimestamp, createJsonSqlInputForColumn, getJsonArray, getMetaData, getMetaDataOfBinds, getNumberOfBinds, getResultSetSerializables, getRow, getSession, getSessionTimezone, getSessionTimeZone, isBeforeFirst, isClosed, isFirst, previous, relative, setSession, wasNull`

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

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

### Field Detail

#### statement

    protected SFBaseStatement statement

### Constructor Detail

#### SFResultSet

    public SFResultSet​(SnowflakeResultSetSerializableV1 resultSetSerializable,
                       SFBaseStatement statement,
                       boolean sortResult)
                throws SQLException

Constructor takes a result from the API response that we get from executing a SQL statement.

The constructor will initialize the ResultSetMetaData.

Parameters:
  `resultSetSerializable` - result data after parsing
  `statement` - statement object
  `sortResult` - true if sort results otherwise false
Throws:
  `SQLException` - exception raised from general SQL layers

#### SFResultSet

    public SFResultSet​(SnowflakeResultSetSerializableV1 resultSetSerializable,
                       Telemetry telemetryClient,
                       boolean sortResult)
                throws SQLException

This is a minimum initialization for SFResultSet. Mainly used for testing purpose. However, real prod constructor will call this constructor as well

Parameters:
  `resultSetSerializable` - data returned in query response
  `telemetryClient` - telemetryClient
  `sortResult` - should sorting take place
Throws:
  `SQLException` - if exception is encountered

#### SFResultSet

    public SFResultSet​(SnowflakeResultSetSerializableV1 resultSetSerializable,
                       SFBaseSession session,
                       Telemetry telemetryClient,
                       boolean sortResult)
                throws SQLException

This is a minimum initialization for SFResultSet. Mainly used for testing purpose. However, real prod constructor will call this constructor as well

Parameters:
  `resultSetSerializable` - data returned in query response
  `session` - snowflake session
  `telemetryClient` - telemetryClient
  `sortResult` - should sorting take place
Throws:
  `SQLException` - if an exception is encountered.

### Method Detail

#### next

    public boolean next()
                 throws SFException,
                        SnowflakeSQLException

Advance to next row

Overrides:
  `next` in class `SFBaseResultSet`
Returns:
  true if next row exists, false otherwise
Throws:
  `SFException`
  `SnowflakeSQLException`

#### getObjectInternal

    protected Object getObjectInternal​(int columnIndex)
                                throws SFException

Description copied from class: `SFJsonResultSet`
Given a column index, get current row's value as an object

Specified by:
  `getObjectInternal` in class `SFJsonResultSet`
Parameters:
  `columnIndex` - index of columns
Returns:
  an object
Throws:
  `SFException` - raises if any error occurs

#### isLast

    public boolean isLast()

Specified by:
  `isLast` in class `SFBaseResultSet`

#### isAfterLast

    public boolean isAfterLast()

Specified by:
  `isAfterLast` in class `SFBaseResultSet`

#### close

    public void close()
               throws SnowflakeSQLException

Overrides:
  `close` in class `SFBaseResultSet`
Throws:
  `SnowflakeSQLException`

#### getStatementType

    public SFStatementType getStatementType()

Specified by:
  `getStatementType` in class `SFBaseResultSet`

#### setStatementType

    public void setStatementType​(SFStatementType statementType)

Specified by:
  `setStatementType` in class `SFBaseResultSet`

#### isArrayBindSupported

    public boolean isArrayBindSupported()

Overrides:
  `isArrayBindSupported` in class `SFBaseResultSet`

#### getQueryId

    public String getQueryId()

Specified by:
  `getQueryId` in class `SFBaseResultSet`