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.JsonNode
getInput()
String
getText()
<T> T[]
readArray(Class<T> type)
Reads the next attribute in the stream and returns it as aArray
object.BigDecimal
readBigDecimal()
boolean
readBoolean()
byte
readByte()
byte[]
readBytes()
Date
readDate()
double
readDouble()
float
readFloat()
int
readInt()
<T> List<T>
readList(Class<T> type)
Reads the next attribute in the stream and returns it as aList
object.long
readLong()
<T> Map<String,T>
readMap(Class<T> type)
Reads the next attribute in the stream and returns it as aMap
object.Object
readObject()
<T> T
readObject(Class<T> type)
<T> T
readObject(Class<T> type, TimeZone tz)
Reads the next attribute in the stream and returns it as aObject
object.short
readShort()
String
readString()
Time
readTime()
Timestamp
readTimestamp()
Timestamp
readTimestamp(TimeZone tz)
Reads the next attribute in the stream and returns it as ajava.sql.Timestamp
object.boolean
wasNull()
-
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:
readTimestamp
in interfaceSQLInput
- Overrides:
readTimestamp
in classBaseSqlInput
- Throws:
SQLException
-
readTimestamp
public Timestamp readTimestamp(TimeZone tz) throws SQLException
Description copied from interface:SFSqlInput
Reads the next attribute in the stream and returns it as ajava.sql.Timestamp
object.- 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:SFSqlInput
Reads the next attribute in the stream and returns it as aObject
object.- 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
Object
in the Java programming language;null
if 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:SFSqlInput
Reads the next attribute in the stream and returns it as aList
object.- 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
List
in the Java programming language;null
if 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:SFSqlInput
Reads the next attribute in the stream and returns it as aArray
object.- 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
Array
in the Java programming language;null
if 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:SFSqlInput
Reads the next attribute in the stream and returns it as aMap
object.- 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
Map
in the Java programming language;null
if 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:
wasNull
in interfaceSQLInput
- Overrides:
wasNull
in classBaseSqlInput
-
-