Package net.snowflake.client.core
Class SFJsonResultSet
- java.lang.Object
-
- net.snowflake.client.core.SFBaseResultSet
-
- net.snowflake.client.core.SFJsonResultSet
-
- Direct Known Subclasses:
SFFixedViewResultSet,SFResultSet
public abstract class SFJsonResultSet extends SFBaseResultSet
Abstract class used to represent snowflake result set in json format
-
-
Field Summary
Fields Modifier and Type Field Description protected Convertersconvertersprotected com.fasterxml.jackson.databind.ObjectMapperobjectMapper-
Fields inherited from class net.snowflake.client.core.SFBaseResultSet
isClosed, metaDataOfBinds, numberOfBinds, OBJECT_MAPPER, parameters, resultSetMetaData, resultSetSerializable, resultVersion, row, session, sessionTimeZone
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSFJsonResultSet(TimeZone sessionTimeZone, Converters converters)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description DateconvertToDate(Object object, TimeZone tz)TimeconvertToTime(Object object, int scale)TimestampconvertToTimestamp(Object object, int columnType, int columnSubType, TimeZone tz, int scale)SQLInputcreateSqlInputForColumn(Object input, Class<?> parentObjectClass, int columnIndex, SFBaseSession session, List<FieldMetadata> fields)ArraygetArray(int columnIndex)BigDecimalgetBigDecimal(int columnIndex)BigDecimalgetBigDecimal(int columnIndex, int scale)booleangetBoolean(int columnIndex)bytegetByte(int columnIndex)byte[]getBytes(int columnIndex)ConvertersgetConverters()DategetDate(int columnIndex)DategetDate(int columnIndex, TimeZone tz)doublegetDouble(int columnIndex)DurationgetDuration(int columnIndex)floatgetFloat(int columnIndex)intgetInt(int columnIndex)longgetLong(int columnIndex)ObjectgetObject(int columnIndex)protected abstract ObjectgetObjectInternal(int columnIndex)Given a column index, get current row's value as an objectObjectgetObjectWithoutString(int columnIndex)PeriodgetPeriod(int columnIndex)shortgetShort(int columnIndex)StringgetString(int columnIndex)TimegetTime(int columnIndex)TimestampgetTimestamp(int columnIndex, TimeZone tz)-
Methods inherited from class net.snowflake.client.core.SFBaseResultSet
absolute, close, convertStringToDate, convertStringToTime, convertStringToTimestamp, createJsonSqlInputForColumn, getJsonArray, getMetaData, getMetaDataOfBinds, getNumberOfBinds, getQueryId, getResultSetSerializables, getRow, getSession, getSessionTimezone, getSessionTimeZone, getStatementType, isAfterLast, isArrayBindSupported, isBeforeFirst, isClosed, isFirst, isLast, next, previous, relative, setSession, setStatementType, wasNull
-
-
-
-
Field Detail
-
converters
protected final Converters converters
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Detail
-
SFJsonResultSet
protected SFJsonResultSet(TimeZone sessionTimeZone, Converters converters)
-
-
Method Detail
-
getObjectInternal
protected abstract Object getObjectInternal(int columnIndex) throws SFException
Given a column index, get current row's value as an object- Parameters:
columnIndex- index of columns- Returns:
- an object
- Throws:
SFException- raises if any error occurs
-
getObject
public Object getObject(int columnIndex) throws SFException
- Specified by:
getObjectin classSFBaseResultSet- Throws:
SFException
-
getObjectWithoutString
@SnowflakeJdbcInternalApi public Object getObjectWithoutString(int columnIndex) throws SFException
- Specified by:
getObjectWithoutStringin classSFBaseResultSet- Throws:
SFException
-
getArray
public Array getArray(int columnIndex) throws SFException
- Overrides:
getArrayin classSFBaseResultSet- Throws:
SFException
-
getString
public String getString(int columnIndex) throws SFException
- Specified by:
getStringin classSFBaseResultSet- Throws:
SFException
-
getBoolean
public boolean getBoolean(int columnIndex) throws SFException- Specified by:
getBooleanin classSFBaseResultSet- Throws:
SFException
-
getByte
public byte getByte(int columnIndex) throws SFException- Specified by:
getBytein classSFBaseResultSet- Throws:
SFException
-
getPeriod
public Period getPeriod(int columnIndex) throws SFException
- Specified by:
getPeriodin classSFBaseResultSet- Throws:
SFException
-
getDuration
public Duration getDuration(int columnIndex) throws SFException
- Specified by:
getDurationin classSFBaseResultSet- Throws:
SFException
-
getShort
public short getShort(int columnIndex) throws SFException- Specified by:
getShortin classSFBaseResultSet- Throws:
SFException
-
getInt
public int getInt(int columnIndex) throws SFException- Specified by:
getIntin classSFBaseResultSet- Throws:
SFException
-
getLong
public long getLong(int columnIndex) throws SFException- Specified by:
getLongin classSFBaseResultSet- Throws:
SFException
-
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex) throws SFException
- Specified by:
getBigDecimalin classSFBaseResultSet- Throws:
SFException
-
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SFException
- Specified by:
getBigDecimalin classSFBaseResultSet- Throws:
SFException
-
getTime
public Time getTime(int columnIndex) throws SFException
- Specified by:
getTimein classSFBaseResultSet- Throws:
SFException
-
getTimestamp
public Timestamp getTimestamp(int columnIndex, TimeZone tz) throws SFException
- Specified by:
getTimestampin classSFBaseResultSet- Throws:
SFException
-
getFloat
public float getFloat(int columnIndex) throws SFException- Specified by:
getFloatin classSFBaseResultSet- Throws:
SFException
-
getDouble
public double getDouble(int columnIndex) throws SFException- Specified by:
getDoublein classSFBaseResultSet- Throws:
SFException
-
getBytes
public byte[] getBytes(int columnIndex) throws SFException- Specified by:
getBytesin classSFBaseResultSet- Throws:
SFException
-
getDate
public Date getDate(int columnIndex) throws SFException
- Throws:
SFException
-
getDate
public Date getDate(int columnIndex, TimeZone tz) throws SFException
- Specified by:
getDatein classSFBaseResultSet- Throws:
SFException
-
createSqlInputForColumn
@SnowflakeJdbcInternalApi public SQLInput createSqlInputForColumn(Object input, Class<?> parentObjectClass, int columnIndex, SFBaseSession session, List<FieldMetadata> fields)
- Overrides:
createSqlInputForColumnin classSFBaseResultSet
-
convertToDate
@SnowflakeJdbcInternalApi public Date convertToDate(Object object, TimeZone tz) throws SFException
- Overrides:
convertToDatein classSFBaseResultSet- Throws:
SFException
-
convertToTime
@SnowflakeJdbcInternalApi public Time convertToTime(Object object, int scale) throws SFException
- Overrides:
convertToTimein classSFBaseResultSet- Throws:
SFException
-
convertToTimestamp
@SnowflakeJdbcInternalApi public Timestamp convertToTimestamp(Object object, int columnType, int columnSubType, TimeZone tz, int scale) throws SFException
- Overrides:
convertToTimestampin classSFBaseResultSet- Throws:
SFException
-
getConverters
@SnowflakeJdbcInternalApi public Converters getConverters()
- Overrides:
getConvertersin classSFBaseResultSet
-
-