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
OracleJsonDatumcan be used with JDBC methods such asOracleResultSet.getOracleObject(int)andOraclePreparedStatement.setOracleObject(int, Datum)that accept and returnDatum. The primary use case forOracleJsonDatumis 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
-
<section role="region">
-
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 booleanisConvertibleTo(Class arg0)Determines if datum object can be converted to a particular classObjectmakeJdbcArray(int size)Returns a JDBC array representation of the datumObjecttoJdbc()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
-
-
-
<section role="region">
-
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:DatumDetermines if datum object can be converted to a particular class- Specified by:
isConvertibleToin 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:DatumReturns a JDBC array representation of the datum- Specified by:
makeJdbcArrayin 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:DatumReturns the JDBC representation of the datum object- Specified by:
toJdbcin classDatum- Returns:
- an object containing the JDBC value
- Throws:
SQLException- if conversion to JDBC representation results in an error
-
-