Package oracle.sql.json
Class OracleJsonDatum
- java.lang.Object
-
- oracle.sql.Datum
-
- oracle.sql.json.OracleJsonDatum
-
- All Implemented Interfaces:
Serializable
public class OracleJsonDatum extends Datum
Represents a JSON type value and holds Oracle binary JSON.
Instances of
OracleJsonDatum
can be used with JDBC methods such asOracleResultSet.getOracleObject(int)
andOraclePreparedStatement.setOracleObject(int, Datum)
that accept and returnDatum
. The primary use case forOracleJsonDatum
is to obtain raw Oracle binary JSON directly from a query result. For example:ResultSet rs = stmt.executeQuery("select jsonCol from mytbl"); rs.next(); OracleJsonDatum datum = rs.getObject(1, OracleJsonDatum.class); byte[] binaryJson = datum.shareBytes(); ...
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class oracle.sql.Datum
ojiOracleDatumWithConnection, targetDatum
-
-
Constructor Summary
Constructors Constructor Description OracleJsonDatum(byte[] binaryJson)
Creates a new datum with the given byte array containing Oracle binary JSON.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isConvertibleTo(Class arg0)
Determines if datum object can be converted to a particular classObject
makeJdbcArray(int size)
Returns a JDBC array representation of the datumObject
toJdbc()
Returns the JDBC representation of the datum object-
Methods inherited from class oracle.sql.Datum
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, bytesEqual, bytesHashCode, byteValue, characterStreamValue, compareBytes, dateValue, doubleValue, equals, floatValue, getBytes, getConnectionDuringExceptionHandling, getLength, getStream, intValue, isNull, longValue, setBytes, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue, toClass
-
-
-
-
Method Detail
-
isConvertibleTo
public boolean isConvertibleTo(Class arg0)
Description copied from class:Datum
Determines if datum object can be converted to a particular class- Specified by:
isConvertibleTo
in classDatum
- Parameters:
arg0
- Class to convert to- Returns:
- true, if conversion to cls is permitted false, if conversion to cls is not permitted
-
makeJdbcArray
public Object makeJdbcArray(int size)
Description copied from class:Datum
Returns a JDBC array representation of the datum- Specified by:
makeJdbcArray
in classDatum
- Parameters:
size
- size of the array- Returns:
- an object containing the JDBC array value
-
toJdbc
public Object toJdbc() throws SQLException
Description copied from class:Datum
Returns the JDBC representation of the datum object- Specified by:
toJdbc
in classDatum
- Returns:
- an object containing the JDBC value
- Throws:
SQLException
- if conversion to JDBC representation results in an error
-
-