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 as `OracleResultSet.getOracleObject(int)` and `OraclePreparedStatement.setOracleObject(int, Datum)` that accept and return `Datum`. The primary use case for `OracleJsonDatum` 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 and 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
`boolean` `isConvertibleTo(Class arg0)` Determines if datum object can be converted to a particular class
`Object` `makeJdbcArray(int size)` Returns a JDBC array representation of the datum
`Object` `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`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### OracleJsonDatum

    public OracleJsonDatum(byte[] binaryJson)

Creates a new datum with the given byte array containing Oracle binary JSON.

Parameters:
  `binaryJson` - binary JSON to be stored in the datum

### 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 class `Datum`
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 class `Datum`
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 class `Datum`
Returns:
  an object containing the JDBC value
Throws:
  `SQLException` - if conversion to JDBC representation results in an error

Copyright © 2008, 2020, Oracle and/or its affiliates. All rights reserved.