Package net.snowflake.client.core
Class SFBaseResultSet
- java.lang.Object
-
- net.snowflake.client.core.SFBaseResultSet
-
- Direct Known Subclasses:
SFArrowResultSet
,SFJsonResultSet
public abstract class SFBaseResultSet extends Object
Base class for query result set and metadata result set
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isClosed
protected List<MetaDataOfBinds>
metaDataOfBinds
protected int
numberOfBinds
protected static com.fasterxml.jackson.databind.ObjectMapper
OBJECT_MAPPER
protected Map<String,Object>
parameters
protected SFResultSetMetaData
resultSetMetaData
protected SnowflakeResultSetSerializableV1
resultSetSerializable
protected long
resultVersion
protected int
row
protected SFBaseSession
session
protected TimeZone
sessionTimeZone
-
Constructor Summary
Constructors Constructor Description SFBaseResultSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
absolute(int row)
void
close()
protected Date
convertStringToDate(String object, TimeZone tz)
protected Time
convertStringToTime(String object, int scale)
protected Timestamp
convertStringToTimestamp(String object, int columnType, int columnSubType, TimeZone tz, int scale)
Date
convertToDate(Object object, TimeZone tz)
Time
convertToTime(Object object, int scale)
Timestamp
convertToTimestamp(Object object, int columnType, int columnSubType, TimeZone tz, int scale)
protected SQLInput
createJsonSqlInputForColumn(Object input, SFBaseSession session, List<FieldMetadata> fields)
SQLInput
createSqlInputForColumn(Object input, Class<?> parentObjectClass, int columnIndex, SFBaseSession session, List<FieldMetadata> fields)
Array
getArray(int columnIndex)
abstract BigDecimal
getBigDecimal(int columnIndex)
abstract BigDecimal
getBigDecimal(int columnIndex, int scale)
abstract boolean
getBoolean(int columnIndex)
abstract byte
getByte(int columnIndex)
abstract byte[]
getBytes(int columnIndex)
Converters
getConverters()
abstract Date
getDate(int columnIndex, TimeZone tz)
abstract double
getDouble(int columnIndex)
abstract float
getFloat(int columnIndex)
abstract int
getInt(int columnIndex)
protected SfSqlArray
getJsonArray(String arrayString, int columnIndex)
abstract long
getLong(int columnIndex)
SFResultSetMetaData
getMetaData()
List<MetaDataOfBinds>
getMetaDataOfBinds()
int
getNumberOfBinds()
abstract Object
getObject(int columnIndex)
abstract Object
getObjectWithoutString(int columnIndex)
abstract String
getQueryId()
List<SnowflakeResultSetSerializable>
getResultSetSerializables(long maxSizeInBytes)
Split this whole SnowflakeResultSetSerializable into small pieces based on the user specified data size.int
getRow()
SFBaseSession
getSession()
TimeZone
getSessionTimezone()
TimeZone
getSessionTimeZone()
abstract short
getShort(int columnIndex)
abstract SFStatementType
getStatementType()
abstract String
getString(int columnIndex)
abstract Time
getTime(int columnIndex)
abstract Timestamp
getTimestamp(int columnIndex, TimeZone tz)
abstract boolean
isAfterLast()
boolean
isArrayBindSupported()
boolean
isBeforeFirst()
boolean
isClosed()
boolean
isFirst()
abstract boolean
isLast()
boolean
next()
boolean
previous()
boolean
relative(int rows)
void
setSession(SFBaseSession session)
abstract void
setStatementType(SFStatementType statementType)
boolean
wasNull()
-
-
-
Field Detail
-
OBJECT_MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
-
resultSetMetaData
protected SFResultSetMetaData resultSetMetaData
-
row
protected int row
-
resultVersion
protected long resultVersion
-
numberOfBinds
protected int numberOfBinds
-
metaDataOfBinds
protected List<MetaDataOfBinds> metaDataOfBinds
-
session
protected SFBaseSession session
-
isClosed
protected boolean isClosed
-
resultSetSerializable
protected SnowflakeResultSetSerializableV1 resultSetSerializable
-
sessionTimeZone
protected TimeZone sessionTimeZone
-
-
Method Detail
-
isLast
public abstract boolean isLast()
-
isAfterLast
public abstract boolean isAfterLast()
-
getString
public abstract String getString(int columnIndex) throws SFException
- Throws:
SFException
-
getBoolean
public abstract boolean getBoolean(int columnIndex) throws SFException
- Throws:
SFException
-
getByte
public abstract byte getByte(int columnIndex) throws SFException
- Throws:
SFException
-
getShort
public abstract short getShort(int columnIndex) throws SFException
- Throws:
SFException
-
getInt
public abstract int getInt(int columnIndex) throws SFException
- Throws:
SFException
-
getLong
public abstract long getLong(int columnIndex) throws SFException
- Throws:
SFException
-
getFloat
public abstract float getFloat(int columnIndex) throws SFException
- Throws:
SFException
-
getDouble
public abstract double getDouble(int columnIndex) throws SFException
- Throws:
SFException
-
getBytes
public abstract byte[] getBytes(int columnIndex) throws SFException
- Throws:
SFException
-
getTime
public abstract Time getTime(int columnIndex) throws SFException
- Throws:
SFException
-
getTimestamp
public abstract Timestamp getTimestamp(int columnIndex, TimeZone tz) throws SFException
- Throws:
SFException
-
getDate
public abstract Date getDate(int columnIndex, TimeZone tz) throws SFException
- Throws:
SFException
-
getObject
public abstract Object getObject(int columnIndex) throws SFException
- Throws:
SFException
-
getObjectWithoutString
@SnowflakeJdbcInternalApi public abstract Object getObjectWithoutString(int columnIndex) throws SFException
- Throws:
SFException
-
getArray
public Array getArray(int columnIndex) throws SFException
- Throws:
SFException
-
getBigDecimal
public abstract BigDecimal getBigDecimal(int columnIndex) throws SFException
- Throws:
SFException
-
getBigDecimal
public abstract BigDecimal getBigDecimal(int columnIndex, int scale) throws SFException
- Throws:
SFException
-
getStatementType
public abstract SFStatementType getStatementType()
-
setStatementType
public abstract void setStatementType(SFStatementType statementType) throws SQLException
- Throws:
SQLException
-
getQueryId
public abstract String getQueryId()
-
setSession
public void setSession(SFBaseSession session)
-
getSession
public SFBaseSession getSession()
-
next
public boolean next() throws SFException, SnowflakeSQLException
- Throws:
SFException
SnowflakeSQLException
-
close
public void close() throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
wasNull
public boolean wasNull()
-
getMetaData
public SFResultSetMetaData getMetaData()
-
getSessionTimezone
public TimeZone getSessionTimezone()
-
getRow
public int getRow() throws SQLException
- Throws:
SQLException
-
absolute
public boolean absolute(int row) throws SFException
- Throws:
SFException
-
relative
public boolean relative(int rows) throws SFException
- Throws:
SFException
-
previous
public boolean previous() throws SFException
- Throws:
SFException
-
getNumberOfBinds
public int getNumberOfBinds()
-
getMetaDataOfBinds
public List<MetaDataOfBinds> getMetaDataOfBinds()
-
isFirst
public boolean isFirst()
-
isBeforeFirst
public boolean isBeforeFirst()
-
isClosed
public boolean isClosed()
-
isArrayBindSupported
public boolean isArrayBindSupported()
-
getResultSetSerializables
public List<SnowflakeResultSetSerializable> getResultSetSerializables(long maxSizeInBytes) throws SQLException
Split this whole SnowflakeResultSetSerializable into small pieces based on the user specified data size.- Parameters:
maxSizeInBytes
- The expected max data size wrapped in the ResultSetSerializables object. NOTE: this parameter is intended to make the data size in each serializable object to be less than it. But if user specifies a small value which may be smaller than the data size of one result chunk. So the definition can't be guaranteed completely. For this special case, one serializable object is used to wrap the data chunk.- Returns:
- a list of SnowflakeResultSetSerializable
- Throws:
SQLException
- if fails to split objects.
-
getConverters
@SnowflakeJdbcInternalApi public Converters getConverters()
-
getSessionTimeZone
@SnowflakeJdbcInternalApi public TimeZone getSessionTimeZone()
-
createSqlInputForColumn
@SnowflakeJdbcInternalApi public SQLInput createSqlInputForColumn(Object input, Class<?> parentObjectClass, int columnIndex, SFBaseSession session, List<FieldMetadata> fields)
-
convertToDate
@SnowflakeJdbcInternalApi public Date convertToDate(Object object, TimeZone tz) throws SFException
- Throws:
SFException
-
convertToTime
@SnowflakeJdbcInternalApi public Time convertToTime(Object object, int scale) throws SFException
- Throws:
SFException
-
convertToTimestamp
@SnowflakeJdbcInternalApi public Timestamp convertToTimestamp(Object object, int columnType, int columnSubType, TimeZone tz, int scale) throws SFException
- Throws:
SFException
-
createJsonSqlInputForColumn
@SnowflakeJdbcInternalApi protected SQLInput createJsonSqlInputForColumn(Object input, SFBaseSession session, List<FieldMetadata> fields)
-
getJsonArray
@SnowflakeJdbcInternalApi protected SfSqlArray getJsonArray(String arrayString, int columnIndex) throws SFException
- Throws:
SFException
-
convertStringToDate
@SnowflakeJdbcInternalApi protected Date convertStringToDate(String object, TimeZone tz) throws SFException
- Throws:
SFException
-
convertStringToTime
@SnowflakeJdbcInternalApi protected Time convertStringToTime(String object, int scale) throws SFException
- Throws:
SFException
-
convertStringToTimestamp
@SnowflakeJdbcInternalApi protected Timestamp convertStringToTimestamp(String object, int columnType, int columnSubType, TimeZone tz, int scale) throws SFException
- Throws:
SFException
-
-