Package oracle.sql
Class RAW
java.lang.Object
oracle.sql.Datum
oracle.sql.RAW
- All Implemented Interfaces:
Serializable
The RAW class is a representation of the Oracle RAW datatype.
It is intended to be immutable. The user should not try to change
its contents once it is constructed.
- See Also:
-
Field Summary
Fields inherited from class oracle.sql.Datum
ojiOracleDatumWithConnection, targetDatum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected oracle.jdbc.internal.OracleConnectionstatic byte[]hexString2Bytes(String hexString) Converts a String of hex digits into a byte array with the corresponding byte values.booleanisConvertibleTo(Class<?> jClass) Test whether this data object can be converted to the specified Java data type.static RAWCreates a new RAW from an Object in the manner of the RAW(Object) constructor beginning in 10i R1.static RAWCreates a new RAW from an Object in the manner of the RAW(Object) constructor in versions of Oracle JDBC 9.2 and earlier.Convert this data object into a String.toJdbc()Convert this data object into its default Java object type.Methods inherited from class oracle.sql.Datum
bigDecimalValue, booleanValue, bytesEqual, bytesHashCode, byteValue, compareBytes, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, isNull, longValue, setBytes, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValue, toClass
-
Constructor Details
-
RAW
public RAW(byte[] raw_bytes) Construct a RAW from a byte array.- Parameters:
raw_bytes- input data from which this class instance is constructed.
-
RAW
Deprecated.in 9.2. The behavior of this constructor when passed a String argument will be changed in the next major release after 9.2. There will be no change in the behavior when passed an argument of any other type. The static methods newRAW and oldRAW capture the new and old behavior. It is deprecated only to warn of the impending change in behavior. The deprecation will be removed in the next major release after 9.2. The constructor will remain and will be supported. See release notes for more info.Construct a RAW from a Java object. The possible object types are java.lang.String and byte[].- Parameters:
val- input data from which this class instance is constructed.- Throws:
SQLException
-
-
Method Details
-
hexString2Bytes
Converts a String of hex digits into a byte array with the corresponding byte values.- Parameters:
hexString- A String of hex digits- Returns:
- a byte array half the length of the argument with the value corresponding to the argument
- Throws:
SQLException- if one of the characters in the argument is not a hex digit
-
newRAW
Creates a new RAW from an Object in the manner of the RAW(Object) constructor beginning in 10i R1. The only difference is if the argument is a String. This method assumes that the String consists of hex digits and returns a new RAW constructed from the bytes represented by those hex digits. If the argument is not a String then the behavior is the same as the RAW(Object) constructor.In Oracle JDBC versions beginning in 10i R1 this is identical to RAW(Object). In versions 9.2 and earlier, it provides the functionality that will be provided in versions beginning in 10i R1.
Note that the behavior of RAW(Object) when passed a String argument changed in 10i R1.
- Parameters:
obj- Object used to create the new RAW value- Returns:
- a new RAW value
- Throws:
SQLException- if the argument is a String and one of the characters is not a hex digit- See Also:
-
oldRAW
Creates a new RAW from an Object in the manner of the RAW(Object) constructor in versions of Oracle JDBC 9.2 and earlier. The only difference is if the argument is a String. This method returns a new RAW containing the bytes of the ISO8859_1 representation of the String argument. If the argument is not a String then it is the same as the RAW(Object) constructor.In Oracle JDBC versions 9.2 and earlier this is identical to the RAW(Object) constructor. Beginning in 10i R1, it provides the functionality that previously was provided by that constructor.
Note that the behavior of RAW(Object) when passed a String argument changed in 10i R1.
- Parameters:
obj- Object used to create the RAW value- Returns:
- a new RAW value
- Throws:
SQLException- if something goes wrong- See Also:
-
toJdbc
Convert this data object into its default Java object type.- Specified by:
toJdbcin classDatum- Returns:
- the data value as a byte array.
- Throws:
SQLException- if any of the lower layer code throws an exception.
-
isConvertibleTo
Test whether this data object can be converted to the specified Java data type.- Specified by:
isConvertibleToin classDatum- Parameters:
jClass- specifies the Java data type to test against.- Returns:
- true if this data object is convertible to the specified Java class, and a corresponding xxxValue() method is available; otherwise, a false is returned.
-
stringValue
Convert this data object into a String.- Overrides:
stringValuein classDatum- Returns:
- the data value in String representation.
-
getConnectionDuringExceptionHandling
protected oracle.jdbc.internal.OracleConnection getConnectionDuringExceptionHandling()- Overrides:
getConnectionDuringExceptionHandlingin classDatum
-