Package net.snowflake.client.core
Class JsonSqlInput
- java.lang.Object
-
- net.snowflake.client.core.BaseSqlInput
-
- net.snowflake.client.core.JsonSqlInput
-
- All Implemented Interfaces:
SQLInput,SFSqlInput
@SnowflakeJdbcInternalApi public class JsonSqlInput extends BaseSqlInput
-
-
Field Summary
-
Fields inherited from class net.snowflake.client.core.BaseSqlInput
converters, fields, session
-
-
Constructor Summary
Constructors Constructor Description JsonSqlInput(String text, com.fasterxml.jackson.databind.JsonNode input, SFBaseSession session, Converters converters, List<FieldMetadata> fields, TimeZone sessionTimeZone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNodegetInput()StringgetText()<T> T[]readArray(Class<T> type)Reads the next attribute in the stream and returns it as aArrayobject.BigDecimalreadBigDecimal()booleanreadBoolean()bytereadByte()byte[]readBytes()DatereadDate()doublereadDouble()floatreadFloat()intreadInt()<T> List<T>readList(Class<T> type)Reads the next attribute in the stream and returns it as aListobject.longreadLong()<T> Map<String,T>readMap(Class<T> type)Reads the next attribute in the stream and returns it as aMapobject.ObjectreadObject()<T> TreadObject(Class<T> type)<T> TreadObject(Class<T> type, TimeZone tz)Reads the next attribute in the stream and returns it as aObjectobject.shortreadShort()StringreadString()TimereadTime()TimestampreadTimestamp()TimestampreadTimestamp(TimeZone tz)Reads the next attribute in the stream and returns it as ajava.sql.Timestampobject.booleanwasNull()-
Methods inherited from class net.snowflake.client.core.BaseSqlInput
convertBigDecimal, convertBoolean, convertBytes, convertDouble, convertFloat, convertInt, convertLong, convertShort, convertString, readArray, readAsciiStream, readBinaryStream, readBlob, readCharacterStream, readClob, readNClob, readNString, readRef, readRowId, readSQLXML, readURL
-
-
-
-
Constructor Detail
-
JsonSqlInput
public JsonSqlInput(String text, com.fasterxml.jackson.databind.JsonNode input, SFBaseSession session, Converters converters, List<FieldMetadata> fields, TimeZone sessionTimeZone)
-
-
Method Detail
-
getInput
public com.fasterxml.jackson.databind.JsonNode getInput()
-
getText
public String getText()
-
readString
public String readString() throws SQLException
- Throws:
SQLException
-
readBoolean
public boolean readBoolean() throws SQLException- Throws:
SQLException
-
readByte
public byte readByte() throws SQLException- Throws:
SQLException
-
readShort
public short readShort() throws SQLException- Throws:
SQLException
-
readInt
public int readInt() throws SQLException- Throws:
SQLException
-
readLong
public long readLong() throws SQLException- Throws:
SQLException
-
readFloat
public float readFloat() throws SQLException- Throws:
SQLException
-
readDouble
public double readDouble() throws SQLException- Throws:
SQLException
-
readBigDecimal
public BigDecimal readBigDecimal() throws SQLException
- Throws:
SQLException
-
readBytes
public byte[] readBytes() throws SQLException- Throws:
SQLException
-
readDate
public Date readDate() throws SQLException
- Throws:
SQLException
-
readTime
public Time readTime() throws SQLException
- Throws:
SQLException
-
readTimestamp
public Timestamp readTimestamp() throws SQLException
- Specified by:
readTimestampin interfaceSQLInput- Overrides:
readTimestampin classBaseSqlInput- Throws:
SQLException
-
readTimestamp
public Timestamp readTimestamp(TimeZone tz) throws SQLException
Description copied from interface:SFSqlInputReads the next attribute in the stream and returns it as ajava.sql.Timestampobject.- Parameters:
tz- timezone to consider.- Returns:
- the attribute; if the value is SQL
NULL, returnsnull - Throws:
SQLException- if a database access error occurs
-
readObject
public <T> T readObject(Class<T> type, TimeZone tz) throws SQLException
Description copied from interface:SFSqlInputReads the next attribute in the stream and returns it as aObjectobject.- Type Parameters:
T- the type of the class modeled by this Class object- Parameters:
type- Class representing the Java data type to convert the attribute to.tz- timezone to consider.- Returns:
- the attribute at the head of the stream as an
Objectin the Java programming language;nullif the attribute is SQLNULL - Throws:
SQLException- if a database access error occurs
-
readList
public <T> List<T> readList(Class<T> type) throws SQLException
Description copied from interface:SFSqlInputReads the next attribute in the stream and returns it as aListobject.- Type Parameters:
T- the type of the class modeled by this Class object- Parameters:
type- Class representing the Java data type to convert the attribute to.- Returns:
- the attribute at the head of the stream as an
Listin the Java programming language;nullif the attribute is SQLNULL - Throws:
SQLException- if a database access error occurs
-
readArray
public <T> T[] readArray(Class<T> type) throws SQLException
Description copied from interface:SFSqlInputReads the next attribute in the stream and returns it as aArrayobject.- Type Parameters:
T- the type of the class modeled by this Class object- Parameters:
type- Class representing the Java data type to convert the attribute to.- Returns:
- the attribute at the head of the stream as an
Arrayin the Java programming language;nullif the attribute is SQLNULL - Throws:
SQLException- if a database access error occurs
-
readMap
public <T> Map<String,T> readMap(Class<T> type) throws SQLException
Description copied from interface:SFSqlInputReads the next attribute in the stream and returns it as aMapobject.- Type Parameters:
T- the type of the class modeled by this Class object- Parameters:
type- Class representing the Java data type to convert the attribute to.- Returns:
- the attribute at the head of the stream as an
Mapin the Java programming language;nullif the attribute is SQLNULL - Throws:
SQLException- if a database access error occurs
-
readObject
public Object readObject() throws SQLException
- Throws:
SQLException
-
readObject
public <T> T readObject(Class<T> type) throws SQLException
- Throws:
SQLException
-
wasNull
public boolean wasNull()
- Specified by:
wasNullin interfaceSQLInput- Overrides:
wasNullin classBaseSqlInput
-
-