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();
...
ojiOracleDatumWithConnection, targetDatum
Constructor and Description |
---|
OracleJsonDatum(byte[] binaryJson)
Creates a new datum with the given byte array containing
Oracle binary JSON.
|
Modifier and Type | Method and Description |
---|---|
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
|
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
public OracleJsonDatum(byte[] binaryJson)
binaryJson
- binary JSON to be stored in the datumpublic boolean isConvertibleTo(Class arg0)
Datum
isConvertibleTo
in class Datum
arg0
- Class to convert topublic Object makeJdbcArray(int size)
Datum
makeJdbcArray
in class Datum
size
- size of the arraypublic Object toJdbc() throws SQLException
Datum
toJdbc
in class Datum
SQLException
- if conversion to JDBC representation results in
an error