Class OracleJsonDatum

  • All Implemented Interfaces:

    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");;
        OracleJsonDatum datum = rs.getObject(1, OracleJsonDatum.class);
        byte[] binaryJson = datum.shareBytes();
    See Also:
    Serialized Form
    • Constructor Detail

      • OracleJsonDatum

        public OracleJsonDatum​(byte[] binaryJson)
        Creates a new datum with the given byte array containing Oracle binary JSON.
        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
        arg0 - Class to convert to
        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
        size - size of the array
        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
        an object containing the JDBC value
        SQLException - if conversion to JDBC representation results in an error