Package oracle.sql.json
Class OracleJsonDatum
java.lang.Object
oracle.sql.Datum
oracle.sql.json.OracleJsonDatum
- All Implemented Interfaces:
Serializable
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:
-
Field Summary
Fields inherited from class oracle.sql.Datum
ojiOracleDatumWithConnection, targetDatum -
Constructor Summary
ConstructorsConstructorDescriptionOracleJsonDatum(byte[] binaryJson) Creates a new datum with the given byte array containing Oracle binary JSON. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisConvertibleTo(Class arg0) Determines if datum object can be converted to a particular classmakeJdbcArray(int size) Returns a JDBC array representation of the datumtoJdbc()Returns the JDBC representation of the datum objectMethods 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
-
Constructor Details
-
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 Details
-
isConvertibleTo
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
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
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
-