Package net.snowflake.client.jdbc
Class SnowflakeResultSetV1
- java.lang.Object
-
- net.snowflake.client.jdbc.SnowflakeBaseResultSet
-
- net.snowflake.client.jdbc.SnowflakeResultSetV1
-
- All Implemented Interfaces:
AutoCloseable
,ResultSet
,Wrapper
,SnowflakeResultSet
public class SnowflakeResultSetV1 extends SnowflakeBaseResultSet implements SnowflakeResultSet, ResultSet
Snowflake ResultSet implementation
-
-
Field Summary
-
Fields inherited from class net.snowflake.client.jdbc.SnowflakeBaseResultSet
parameters, resultSetMetaData, session, statement
-
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
-
-
Constructor Summary
Constructors Constructor Description SnowflakeResultSetV1(SFBaseResultSet sfBaseResultSet, Statement statement)
Constructor takes an inputstream from the API response that we get from executing a SQL statement.SnowflakeResultSetV1(SFBaseResultSet sfBaseResultSet, SnowflakeResultSetSerializableV1 resultSetSerializable)
Constructor takes a result set serializable object to create a sessionless result set.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
void
close(boolean removeClosedResultSetFromStatement)
BigDecimal
getBigDecimal(int columnIndex)
BigDecimal
getBigDecimal(int columnIndex, int scale)
Deprecated.boolean
getBoolean(int columnIndex)
byte
getByte(int columnIndex)
byte[]
getBytes(int columnIndex)
Date
getDate(int columnIndex, TimeZone tz)
double
getDouble(int columnIndex)
float
getFloat(int columnIndex)
int
getInt(int columnIndex)
long
getLong(int columnIndex)
ResultSetMetaData
getMetaData()
Object
getObject(int columnIndex)
String
getQueryErrorMessage()
This function is not supported for synchronous queriesString
getQueryID()
List<SnowflakeResultSetSerializable>
getResultSetSerializables(long maxSizeInBytes)
Get a list of ResultSetSerializables for the ResultSet in order to parallel processingint
getRow()
short
getShort(int columnIndex)
QueryStatus
getStatus()
This function is not supported for synchronous queriesString
getString(int columnIndex)
Time
getTime(int columnIndex)
Timestamp
getTimestamp(int columnIndex, TimeZone tz)
boolean
isAfterLast()
boolean
isBeforeFirst()
boolean
isClosed()
boolean
isFirst()
boolean
isLast()
boolean
isWrapperFor(Class<?> iface)
boolean
next()
Advance to next row<T> T
unwrap(Class<T> iface)
boolean
wasNull()
-
Methods inherited from class net.snowflake.client.jdbc.SnowflakeBaseResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getByte, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getFetchDirection, getFetchSize, getFloat, getHoldability, getInt, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getSQLXML, getSQLXML, getStatement, getString, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, last, moveToCurrentRow, moveToInsertRow, previous, raiseSQLExceptionIfResultSetIsClosed, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.sql.ResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getByte, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getFetchDirection, getFetchSize, getFloat, getHoldability, getInt, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getSQLXML, getSQLXML, getStatement, getString, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, last, moveToCurrentRow, moveToInsertRow, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp
-
-
-
-
Constructor Detail
-
SnowflakeResultSetV1
public SnowflakeResultSetV1(SFBaseResultSet sfBaseResultSet, Statement statement) throws SQLException
Constructor takes an inputstream from the API response that we get from executing a SQL statement.The constructor will fetch the first row (if any) so that it can initialize the ResultSetMetaData.
- Parameters:
sfBaseResultSet
- snowflake core base result rest objectstatement
- query statement that generates this result set- Throws:
SQLException
- if failed to construct snowflake result set metadata
-
SnowflakeResultSetV1
public SnowflakeResultSetV1(SFBaseResultSet sfBaseResultSet, SnowflakeResultSetSerializableV1 resultSetSerializable) throws SQLException
Constructor takes a result set serializable object to create a sessionless result set.- Parameters:
sfBaseResultSet
- snowflake core base result rest objectresultSetSerializable
- The result set serializable object which includes all metadata to create the result set- Throws:
SQLException
- if fails to create the result set object
-
-
Method Detail
-
getStatus
public QueryStatus getStatus() throws SQLException
This function is not supported for synchronous queries- Specified by:
getStatus
in interfaceSnowflakeResultSet
- Returns:
- no return value; exception is always thrown
- Throws:
SQLFeatureNotSupportedException
SQLException
-
getQueryErrorMessage
public String getQueryErrorMessage() throws SQLException
This function is not supported for synchronous queries- Specified by:
getQueryErrorMessage
in interfaceSnowflakeResultSet
- Returns:
- no return value; exception is always thrown
- Throws:
SQLFeatureNotSupportedException
SQLException
-
next
public boolean next() throws SQLException
Advance to next row- Specified by:
next
in interfaceResultSet
- Specified by:
next
in classSnowflakeBaseResultSet
- Returns:
- true if next row exists, false otherwise
- Throws:
SQLException
- if failed to move to the next row
-
close
public void close() throws SQLException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceResultSet
- Throws:
SQLException
-
close
public void close(boolean removeClosedResultSetFromStatement) throws SQLException
- Throws:
SQLException
-
getQueryID
public String getQueryID()
- Specified by:
getQueryID
in interfaceSnowflakeResultSet
- Returns:
- the Snowflake query ID of the query which generated this result set
-
wasNull
public boolean wasNull() throws SQLException
- Specified by:
wasNull
in interfaceResultSet
- Throws:
SQLException
-
getString
public String getString(int columnIndex) throws SQLException
- Specified by:
getString
in interfaceResultSet
- Throws:
SQLException
-
getBoolean
public boolean getBoolean(int columnIndex) throws SQLException
- Specified by:
getBoolean
in interfaceResultSet
- Throws:
SQLException
-
getByte
public byte getByte(int columnIndex) throws SQLException
- Specified by:
getByte
in interfaceResultSet
- Throws:
SQLException
-
getShort
public short getShort(int columnIndex) throws SQLException
- Specified by:
getShort
in interfaceResultSet
- Throws:
SQLException
-
getInt
public int getInt(int columnIndex) throws SQLException
- Specified by:
getInt
in interfaceResultSet
- Throws:
SQLException
-
getLong
public long getLong(int columnIndex) throws SQLException
- Specified by:
getLong
in interfaceResultSet
- Throws:
SQLException
-
getFloat
public float getFloat(int columnIndex) throws SQLException
- Specified by:
getFloat
in interfaceResultSet
- Throws:
SQLException
-
getDouble
public double getDouble(int columnIndex) throws SQLException
- Specified by:
getDouble
in interfaceResultSet
- Throws:
SQLException
-
getDate
public Date getDate(int columnIndex, TimeZone tz) throws SQLException
- Specified by:
getDate
in classSnowflakeBaseResultSet
- Throws:
SQLException
-
getTime
public Time getTime(int columnIndex) throws SQLException
- Specified by:
getTime
in interfaceResultSet
- Specified by:
getTime
in classSnowflakeBaseResultSet
- Throws:
SQLException
-
getTimestamp
public Timestamp getTimestamp(int columnIndex, TimeZone tz) throws SQLException
- Specified by:
getTimestamp
in classSnowflakeBaseResultSet
- Throws:
SQLException
-
getMetaData
public ResultSetMetaData getMetaData() throws SQLException
- Specified by:
getMetaData
in interfaceResultSet
- Overrides:
getMetaData
in classSnowflakeBaseResultSet
- Throws:
SQLException
-
getObject
public Object getObject(int columnIndex) throws SQLException
- Specified by:
getObject
in interfaceResultSet
- Throws:
SQLException
-
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex) throws SQLException
- Specified by:
getBigDecimal
in interfaceResultSet
- Throws:
SQLException
-
getBigDecimal
@Deprecated public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
Deprecated.- Specified by:
getBigDecimal
in interfaceResultSet
- Throws:
SQLException
-
getBytes
public byte[] getBytes(int columnIndex) throws SQLException
- Specified by:
getBytes
in interfaceResultSet
- Specified by:
getBytes
in classSnowflakeBaseResultSet
- Throws:
SQLException
-
getRow
public int getRow() throws SQLException
- Specified by:
getRow
in interfaceResultSet
- Throws:
SQLException
-
isFirst
public boolean isFirst() throws SQLException
- Specified by:
isFirst
in interfaceResultSet
- Throws:
SQLException
-
isClosed
public boolean isClosed() throws SQLException
- Specified by:
isClosed
in interfaceResultSet
- Specified by:
isClosed
in classSnowflakeBaseResultSet
- Throws:
SQLException
-
isLast
public boolean isLast() throws SQLException
- Specified by:
isLast
in interfaceResultSet
- Throws:
SQLException
-
isAfterLast
public boolean isAfterLast() throws SQLException
- Specified by:
isAfterLast
in interfaceResultSet
- Throws:
SQLException
-
isBeforeFirst
public boolean isBeforeFirst() throws SQLException
- Specified by:
isBeforeFirst
in interfaceResultSet
- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- Specified by:
isWrapperFor
in interfaceWrapper
- Overrides:
isWrapperFor
in classSnowflakeBaseResultSet
- Throws:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- Specified by:
unwrap
in interfaceWrapper
- Overrides:
unwrap
in classSnowflakeBaseResultSet
- Throws:
SQLException
-
getResultSetSerializables
public List<SnowflakeResultSetSerializable> getResultSetSerializables(long maxSizeInBytes) throws SQLException
Get a list of ResultSetSerializables for the ResultSet in order to parallel processing- Specified by:
getResultSetSerializables
in interfaceSnowflakeResultSet
- 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 ResultSetSerializables.
- Throws:
SQLException
- If it fails to get the ResultSetSerializable objects.
-
-