public class TIMESTAMPTZ extends Datum implements oracle.jdbc.internal.OracleTimestampWithTimeZone
The TIMESTAMPTZ class provides conversions between the
Oracle Date (ldx_t) data type and Java classes java.sql.Date,
java.sql.Time, java.sql.Timestamp
The internal data for this object is stored as a thirteen byte array in the super class' storage area. The bytes are arranged as follows:
Byte Represents
0 Century (119 for 1990)
1 Decade (190 for 1990)
2 Month
3 Day
4 Hour
5 Minute
6 Seconds
7 Nanoseconds (Most Significant bit)
8 Nanoseconds
9 Nanoseconds
10 Nanoseconds (Least Significant Bit)
11,12 Region id or Timezone Hour/Minute
The timezone information is stored as an offset in the RegionID format or
in the HOUR/MINUTE format
Static methods are used for conversions.
ojiOracleDatumWithConnection, targetDatum| Constructor and Description |
|---|
TIMESTAMPTZ()
Constructs a TIMESTAMPTZ object initialized to 1/1/1970.
|
TIMESTAMPTZ(byte[] timestamptz)
Create an Oracle TIMESTAMPTZ object represented by the given
Oracle Timestamptz
|
TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Date date)
Create an Oracle TIMESTAMPTZ object represented by the Java Date
|
TIMESTAMPTZ(java.sql.Connection conn,
DATE date)
Create an Oracle TIMESTAMPTZ object represented by the Oracle DATE
|
TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Date date,
java.util.Calendar cal)
Create an Oracle TIMESTAMPTZ object represented by the Java Date
and the Java Calendar object
|
TIMESTAMPTZ(java.sql.Connection conn,
java.time.LocalDateTime ldt)
Create a TIMESTAMPTZ object given a Java LocalDateTime object.
|
TIMESTAMPTZ(java.sql.Connection conn,
java.lang.String str)
Create a TIMESTAMPTZ object given a Java String object.
|
TIMESTAMPTZ(java.sql.Connection conn,
java.lang.String str,
java.util.Calendar cal)
Create a TIMESTAMPTZ object given a Java String object.
|
TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Time time)
Create an Oracle TIMESTAMPTZ object represented by the given Java Time
|
TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Time time,
java.util.Calendar cal)
Create an Oracle TIMESTAMPTZ object represented by the given Java Time
and the Java Calendar object
|
TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Timestamp timestamp)
Create an Oracle TIMESTAMPTZ object represented by the Java Timestamp
|
TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Timestamp timestamp,
java.util.Calendar cal)
Create an Oracle TIMESTAMPTZ object represented by the Java Timestamp
and the Java Calendar object
|
TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Timestamp timestamp,
java.time.ZoneId tzid)
Create an Oracle TIMESTAMPTZ object represented by the Java Timestamp
with the specified ZoneId.
|
TIMESTAMPTZ(java.time.OffsetDateTime odt)
Create a TIMESTAMPTZ object given a Java OffsetDateTime object.
|
TIMESTAMPTZ(java.time.OffsetTime ot)
Create a TIMESTAMPTZ object given a Java OffsetTime object.
|
TIMESTAMPTZ(java.time.ZonedDateTime zdt)
Create a TIMESTAMPTZ object given a Java ZonedDateTime object.
|
| Modifier and Type | Method and Description |
|---|---|
java.sql.Date |
dateValue(java.sql.Connection conn)
Calls toDate to convert internal Oracle TIMESTAMPTZ to a Java Date.
|
java.util.TimeZone |
getTimeZone() |
boolean |
isConvertibleTo(java.lang.Class<?> cls)
Determines if the object can be converted to a particular class
|
java.time.LocalDateTime |
localDateTimeValue()
Calls toLocalDateTime to convert internal Oracle TIMESTAMPTZ to a
Java LocalDateTime.
|
java.lang.Object |
makeJdbcArray(int arraySize)
Returns a JDBC array representation of the datum
|
static TIMESTAMPTZ |
of(java.sql.Connection conn,
java.time.LocalDateTime ldt)
Creates TIMESTAMPTZ from the LocalDateTime.
|
static TIMESTAMPTZ |
of(java.time.OffsetDateTime odt)
Creates TIMESTAMPTZ from the OffsetDateTime.
|
static TIMESTAMPTZ |
of(java.time.ZonedDateTime zdt)
Creates TIMESTAMPTZ from the ZonedDateTime.
|
java.time.OffsetDateTime |
offsetDateTimeValue()
Calls toOffsetDateTime to convert internal Oracle TIMESTAMPTZ to a
Java OffsetDateTime without a connection object.
|
java.time.OffsetDateTime |
offsetDateTimeValue(java.sql.Connection conn)
Calls toOffsetDateTime to convert internal Oracle TIMESTAMPTZ to a
Java OffsetDateTime with a connection object.
|
java.lang.String |
stringValue(java.sql.Connection conn)
Calls toString to convert internal Oracle TIMESTAMPTZ to a Java String.
|
java.sql.Timestamp |
timestampValue(java.sql.Connection conn)
Calls toTimestamp to convert internal Oracle Date to a Java Timestamp.
|
java.sql.Time |
timeValue(java.sql.Connection conn)
Calls toTime to convert internal Oracle Date to a Java Time.
|
byte[] |
toBytes()
Convert Oracle Timestamptz object into a byte array
|
static byte[] |
toBytes(java.sql.Connection conn,
java.sql.Date date)
Convert Java Date to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(java.sql.Connection conn,
DATE date)
Convert Oracle DATE to Oracle TIMESTAMPTZ
|
static byte[] |
toBytes(java.sql.Connection conn,
java.sql.Date date,
java.util.Calendar cal)
Convert Java Date to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(java.sql.Connection conn,
java.time.LocalDateTime ldt)
Convert Java LocalDateTime to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(java.sql.Connection conn,
java.lang.String str)
Convert Java String to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(java.sql.Connection conn,
java.lang.String str,
java.util.Calendar cal)
Convert Java String to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(java.sql.Connection conn,
java.sql.Time time)
Convert Java Time to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(java.sql.Connection conn,
java.sql.Time time,
java.util.Calendar cal)
Convert Java Time to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(java.sql.Connection conn,
java.sql.Timestamp timestamp)
Convert Java Timestamp to Oracle TIMESTAMPTZ
|
static byte[] |
toBytes(java.sql.Connection conn,
java.sql.Timestamp timestamp,
java.util.Calendar cal)
Convert Java Timestamp to Oracle TIMESTAMPTZ
|
static byte[] |
toBytes(java.sql.Connection conn,
java.sql.Timestamp timestamp,
java.time.ZoneId tzid)
Convert Java Timestamp to Oracle TIMESTAMPTZ
|
static byte[] |
toBytes(java.time.OffsetDateTime odt)
Convert Java OffsetDateTime to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(java.time.OffsetTime ot)
Convert Java OffsetTime to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(java.time.ZonedDateTime zdt)
Convert Java ZonedDateTime to Oracle TIMESTAMPTZ.
|
static java.sql.Date |
toDate(java.sql.Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Java Date Object
|
static DATE |
toDATE(java.sql.Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Oracle DATE Object
|
static java.sql.Date |
toDate2(java.sql.Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Java Date Object in accordance with java.sql.Date specification.
|
java.lang.Object |
toJdbc()
Returns the JDBC representation of the timestamptz object
|
java.time.LocalDateTime |
toLocalDateTime()
Converts TIMESTAMPTZ to LocalDateTime.
|
static java.time.LocalDateTime |
toLocalDateTime(byte[] timestamptz)
Converts TIMESTAMPTZ to LocalDateTime.
|
java.time.OffsetDateTime |
toOffsetDateTime()
Converts TIMESTAMPTZ to OffsetDateTime.
|
static java.time.OffsetDateTime |
toOffsetDateTime(java.sql.Connection conn,
byte[] timestamptz)
Converts a TIMESTAMPTZ to an OffsetDateTime
|
java.time.OffsetTime |
toOffsetTime()
Converts a TIMESTAMPTZ to an OffsetTime
|
static java.lang.String |
toString(java.sql.Connection conn,
byte[] timestamptz)
Converts a TIMESTAMPTZ to a string
|
static java.sql.Time |
toTime(java.sql.Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Java Time Object
|
static java.sql.Timestamp |
toTimestamp(java.sql.Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMP WITH TIME ZONE object to a
Java Timestamp Object
|
static TIMESTAMP |
toTIMESTAMP(java.sql.Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Oracle TIMESTAMP Object
|
static java.sql.Timestamp |
toTimestamp2(java.sql.Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Java Timestamp Object
|
java.time.ZonedDateTime |
toZonedDateTime()
Converts TIMESTAMPTZ to ZonedDateTime.
|
static java.time.ZonedDateTime |
toZonedDateTime(byte[] timestamptz)
Converts TIMESTAMPTZ to ZonedDateTime.
|
java.time.ZonedDateTime |
zonedDateTimeValue()
Calls toZonedDateTime to convert internal Oracle TIMESTAMPTZ to a
Java ZonedDateTime.
|
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, toClasspublic TIMESTAMPTZ()
public TIMESTAMPTZ(byte[] timestamptz)
timestamptz - Oracle TIMESTAMPTZpublic TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Date date)
throws java.sql.SQLException
conn - JDBC connection
date Java Date objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Date date,
java.util.Calendar cal)
throws java.sql.SQLException
conn - JDBC connection
date Java Date object
cal java Calendar objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Time time)
throws java.sql.SQLException
conn - JDBC connection
time Java Time objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Time time,
java.util.Calendar cal)
throws java.sql.SQLException
conn - JDBC connection
time Java Time object
cal java Calendar objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Timestamp timestamp)
throws java.sql.SQLException
conn - JDBC connection
timestamp Java Timestamp objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Timestamp timestamp,
java.util.Calendar cal)
throws java.sql.SQLException
conn - JDBC connection
timestamp Java Timestamp object
cal Java Calendar objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
java.sql.Timestamp timestamp,
java.time.ZoneId tzid)
throws java.sql.SQLException
conn - JDBC connection
timestamp Java Timestamp object
tzidstamp Java ZoneId objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
DATE date)
throws java.sql.SQLException
conn - JDBC connection
date Oracle DATE objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
java.lang.String str)
throws java.sql.SQLException
conn - JDBC connection
str Java String objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
java.lang.String str,
java.util.Calendar cal)
throws java.sql.SQLException
conn - JDBC connection
str Java String object
cal Calendar object encapsulating the timezonejava.sql.SQLExceptionpublic TIMESTAMPTZ(java.time.OffsetDateTime odt)
throws java.sql.SQLException
odt - OffsetDateTime objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.time.ZonedDateTime zdt)
throws java.sql.SQLException
zdt - ZonedDateTime objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.sql.Connection conn,
java.time.LocalDateTime ldt)
throws java.sql.SQLException
ldt - LocalDateTime objectjava.sql.SQLExceptionpublic TIMESTAMPTZ(java.time.OffsetTime ot)
throws java.sql.SQLException
ot - OffsetTime objectjava.sql.SQLExceptionpublic static java.sql.Date toDate(java.sql.Connection conn,
byte[] timestamptz)
throws java.sql.SQLException
conn - JDBC connection
timestamptz Oracle TIMESTAMPTZ objectjava.sql.SQLExceptionpublic static java.sql.Date toDate2(java.sql.Connection conn,
byte[] timestamptz)
throws java.sql.SQLException
conn - JDBC connection
timestamptz Oracle TIMESTAMPTZ object in byte arrayjava.sql.SQLExceptionpublic static java.sql.Time toTime(java.sql.Connection conn,
byte[] timestamptz)
throws java.sql.SQLException
conn - JDBC connection
timestamptz Oracle TIMESTAMPTZ objectjava.sql.SQLExceptionpublic static DATE toDATE(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
conn - JDBC connection
timestamptz Oracle TIMESTAMPTZ objectjava.sql.SQLExceptionpublic static TIMESTAMP toTIMESTAMP(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
conn - JDBC connection
timestamptz Oracle TIMESTAMPTZ objectjava.sql.SQLExceptionpublic static java.sql.Timestamp toTimestamp(java.sql.Connection conn,
byte[] timestamptz)
throws java.sql.SQLException
toTimestamp in interface oracle.jdbc.internal.OracleTimestampWithTimeZoneconn - JDBC connection
timestamptz Oracle TIMESTAMPTZ objectjava.sql.SQLExceptionpublic static java.sql.Timestamp toTimestamp2(java.sql.Connection conn,
byte[] timestamptz)
throws java.sql.SQLException
conn - JDBC connection
timestamptz Oracle TIMESTAMPTZ objectjava.sql.SQLExceptionpublic static java.lang.String toString(java.sql.Connection conn,
byte[] timestamptz)
throws java.sql.SQLException
toString in interface oracle.jdbc.internal.OracleTimestampWithTimeZonetimestamptz - a byte arrayjava.sql.SQLExceptionpublic static java.time.OffsetDateTime toOffsetDateTime(java.sql.Connection conn,
byte[] timestamptz)
throws java.sql.SQLException
timestamptz - a byte arrayjava.sql.SQLExceptionpublic java.sql.Timestamp timestampValue(java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLExceptionpublic byte[] toBytes()
toBytes in interface oracle.jdbc.internal.OracleTimestampWithTimeZonepublic static byte[] toBytes(java.sql.Connection conn,
java.sql.Date date)
throws java.sql.SQLException
conn - JDBC connection
date Java Date objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
java.sql.Date date,
java.util.Calendar cal)
throws java.sql.SQLException
conn - JDBC connection
date Java Date object
cal java Calendar objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
java.sql.Time time)
throws java.sql.SQLException
conn - JDBC connection
time Java Time objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
java.sql.Time time,
java.util.Calendar cal)
throws java.sql.SQLException
conn - JDBC connection
time Java Time object
cal java Calendar objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
java.sql.Timestamp timestamp)
throws java.sql.SQLException
conn - JDBC connection
timestamp Java Timestamp objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
java.sql.Timestamp timestamp,
java.util.Calendar cal)
throws java.sql.SQLException
conn - JDBC connection
timestamp Java Timestamp object
cal Java Calendar objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
java.sql.Timestamp timestamp,
java.time.ZoneId tzid)
throws java.sql.SQLException
conn - JDBC connection
timestamp Java Timestamp object
tzid Java ZoneId objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
DATE date)
throws java.sql.SQLException
conn - JDBC connection
date Oracle DATE objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
java.lang.String str)
throws java.sql.SQLException
toBytes in interface oracle.jdbc.internal.OracleTimestampWithTimeZoneconn - JDBC Connection
str java.lang.String object to be converted.java.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
java.lang.String str,
java.util.Calendar cal)
throws java.sql.SQLException
conn - JDBC Connection
str java.lang.String object to be converted.
cal Calendar object encapsulating the timezonejava.sql.SQLExceptionpublic java.lang.String stringValue(java.sql.Connection conn)
throws java.sql.SQLException
stringValue in interface oracle.jdbc.internal.OracleTimestampWithTimeZonestringValue in class Datumconn - oracle.JDBC.OracleConnection objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.time.OffsetDateTime odt)
throws java.sql.SQLException
odt - OffsetDateTime objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.time.ZonedDateTime zdt)
throws java.sql.SQLException
zdt - ZonedDateTime objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.sql.Connection conn,
java.time.LocalDateTime ldt)
throws java.sql.SQLException
zdt - LocalDateTime objectjava.sql.SQLExceptionpublic static byte[] toBytes(java.time.OffsetTime ot)
throws java.sql.SQLException
ot - OffsetTime objectjava.sql.SQLExceptionpublic java.time.OffsetDateTime offsetDateTimeValue()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.time.OffsetDateTime offsetDateTimeValue(java.sql.Connection conn)
throws java.sql.SQLException
a - JDBC Connection objectjava.sql.SQLExceptionpublic java.time.ZonedDateTime zonedDateTimeValue()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.time.LocalDateTime localDateTimeValue()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.sql.Date dateValue(java.sql.Connection conn)
throws java.sql.SQLException
a - JDBC Connection objectjava.sql.SQLExceptionpublic java.sql.Time timeValue(java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.util.TimeZone getTimeZone()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static TIMESTAMPTZ of(java.time.ZonedDateTime zdt) throws java.sql.SQLException
zdt - ZonedDateTime objectjava.sql.SQLExceptionpublic java.time.ZonedDateTime toZonedDateTime()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.time.LocalDateTime toLocalDateTime()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.time.LocalDateTime toLocalDateTime(byte[] timestamptz)
throws java.sql.SQLException
timestamptz - TIMESTAMPTZ datumjava.sql.SQLExceptionpublic static java.time.ZonedDateTime toZonedDateTime(byte[] timestamptz)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.time.OffsetTime toOffsetTime()
throws java.sql.SQLException
timestamptz - a byte arrayjava.sql.SQLExceptionpublic static TIMESTAMPTZ of(java.time.OffsetDateTime odt) throws java.sql.SQLException
odt - OffsetDateTime objectjava.sql.SQLExceptionpublic static TIMESTAMPTZ of(java.sql.Connection conn, java.time.LocalDateTime ldt) throws java.sql.SQLException
conn - Connection objectldt - LocalDateTime objectjava.sql.SQLExceptionpublic java.time.OffsetDateTime toOffsetDateTime()
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.Object toJdbc()
throws java.sql.SQLException
public java.lang.Object makeJdbcArray(int arraySize)
makeJdbcArray in class DatumarraySize - size of the arraypublic boolean isConvertibleTo(java.lang.Class<?> cls)
isConvertibleTo in class Datumcls - Class to convert to