Package oracle.sql
Class INTERVALDS
java.lang.Object
oracle.sql.Datum
oracle.sql.INTERVALDS
- All Implemented Interfaces:
Serializable
INTERVALDS Class
The INTERVALDS class specifies a value to be used to
measure time differences.
The internal data for this object is stored as a 11 byte array in the super class' storage area. The bytes are arranged as follows:
Byte Represents
0 High byte of day
1 2nd high byte of day
2 3rd high byte of day
3 least byte of day
4 hour val + 60
5 min + 60
6 sec + 60
7 High byte of Fractional second
8 2nd high byte of Fractional Second
9 3rd high byte of Fractional Second
10 least byte of Fractional Second
Static methods are used for conversions.
- See Also:
-
Field Summary
Fields inherited from class oracle.sql.Datum
ojiOracleDatumWithConnection, targetDatum -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a INTERVALDS object initialized with .INTERVALDS(byte[] intervalDS) Create an Oracle INTERVALDS object represented by the given intervalDS byte arrayINTERVALDS(String str) Create an Oracle INTERVALDS object represented by the given String -
Method Summary
Modifier and TypeMethodDescriptionConverts and return this object to java.time.Duration objectbooleanisConvertibleTo(Class<?> cls) Determines if the object can be converted to a particular classmakeJdbcArray(int arraySize) Returns a JDBC array representation of the datumReturns String for this INTERVALDS objectbyte[]toBytes()Convert Oracle INTERVALDS object into a byte arraystatic byte[]Convert Java String to Oracle INTERVALDS.static final DurationtoDuration(byte[] bytes) Convert byte array of oracle.sql.INTERVALDS to java.time.Durationstatic final INTERVALDStoIntervalds(Duration duration) Convert java.time.Duration to oracle.sql.INTERVALDStoJdbc()Returns the JDBC representation of the INTERVALDS objecttoString()Converts a INTERVALDS to a stringstatic StringtoString(byte[] inparray) Converts a INTERVALDS to a stringMethods 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, timestampValue, timestampValue, timeValue, timeValue, toClass
-
Constructor Details
-
INTERVALDS
public INTERVALDS()Constructs a INTERVALDS object initialized with . -
INTERVALDS
public INTERVALDS(byte[] intervalDS) Create an Oracle INTERVALDS object represented by the given intervalDS byte array- Parameters:
intervalDS- byte array
-
INTERVALDS
Create an Oracle INTERVALDS object represented by the given String- Parameters:
str- Java String object
-
-
Method Details
-
toBytes
public byte[] toBytes()Convert Oracle INTERVALDS object into a byte array- Returns:
- the byte array stored in the INTERVALDS object
-
toIntervalds
Convert java.time.Duration to oracle.sql.INTERVALDS- Parameters:
duration- java.time.Duration object to be converted to INTERVALDS- Returns:
- INTERVALDS object representing the java.time.Duration object
-
toDuration
Convert byte array of oracle.sql.INTERVALDS to java.time.Duration- Parameters:
bytes- byte array of INTERVALDS object- Returns:
- java.time.Duration object representing the input byte array
-
getDuration
Converts and return this object to java.time.Duration object- Returns:
- Duration object of this INTERVALDS object
-
toBytes
Convert Java String to Oracle INTERVALDS.- Parameters:
str- java.lang.String object to be converted.- Returns:
- the byte array representing the input string.
-
toString
Converts a INTERVALDS to a string- Parameters:
inparray- a byte array representing the INTERVALDS object- Returns:
- String representing the INTERVALDS object
-
toJdbc
Returns the JDBC representation of the INTERVALDS object -
stringValue
Returns String for this INTERVALDS object- Overrides:
stringValuein classDatum- Returns:
- a Java String value
-
toString
Converts a INTERVALDS to a string -
isConvertibleTo
Determines if the object can be converted to a particular class- Specified by:
isConvertibleToin classDatum- Parameters:
cls- Class to convert to- Returns:
- true, if conversion to cls is permitted false, if conversion to cls is not permitted
-
makeJdbcArray
Returns a JDBC array representation of the datum- Specified by:
makeJdbcArrayin classDatum- Parameters:
arraySize- size of the array- Returns:
- an object containing the JDBC array value
-