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, toClasspublic OracleJsonDatum(byte[] binaryJson)
binaryJson - binary JSON to be stored in the datumpublic boolean isConvertibleTo(Class arg0)
DatumisConvertibleTo in class Datumarg0 - Class to convert topublic Object makeJdbcArray(int size)
DatummakeJdbcArray in class Datumsize - size of the arraypublic Object toJdbc() throws SQLException
DatumtoJdbc in class DatumSQLException - if conversion to JDBC representation results in
an error