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/MinuteThe 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(Connection conn,
Date date)
Create an Oracle TIMESTAMPTZ object represented by the Java Date
|
TIMESTAMPTZ(Connection conn,
DATE date)
Create an Oracle TIMESTAMPTZ object represented by the Oracle DATE
|
TIMESTAMPTZ(Connection conn,
Date date,
Calendar cal)
Create an Oracle TIMESTAMPTZ object represented by the Java Date
and the Java Calendar object
|
TIMESTAMPTZ(Connection conn,
java.time.LocalDateTime ldt)
Create a TIMESTAMPTZ object given a Java LocalDateTime object.
|
TIMESTAMPTZ(Connection conn,
String str)
Create a TIMESTAMPTZ object given a Java String object.
|
TIMESTAMPTZ(Connection conn,
String str,
Calendar cal)
Create a TIMESTAMPTZ object given a Java String object.
|
TIMESTAMPTZ(Connection conn,
Time time)
Create an Oracle TIMESTAMPTZ object represented by the given Java Time
|
TIMESTAMPTZ(Connection conn,
Time time,
Calendar cal)
Create an Oracle TIMESTAMPTZ object represented by the given Java Time
and the Java Calendar object
|
TIMESTAMPTZ(Connection conn,
Timestamp timestamp)
Create an Oracle TIMESTAMPTZ object represented by the Java Timestamp
|
TIMESTAMPTZ(Connection conn,
Timestamp timestamp,
Calendar cal)
Create an Oracle TIMESTAMPTZ object represented by the Java Timestamp
and the Java Calendar object
|
TIMESTAMPTZ(Connection conn,
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 |
---|---|
Date |
dateValue(Connection conn)
Calls toDate to convert internal Oracle TIMESTAMPTZ to a Java Date.
|
TimeZone |
getTimeZone() |
boolean |
isConvertibleTo(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.
|
Object |
makeJdbcArray(int arraySize)
Returns a JDBC array representation of the datum
|
static TIMESTAMPTZ |
of(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(Connection conn)
Calls toOffsetDateTime to convert internal Oracle TIMESTAMPTZ to a
Java OffsetDateTime.
|
String |
stringValue(Connection conn)
Calls toString to convert internal Oracle TIMESTAMPTZ to a Java String.
|
Timestamp |
timestampValue(Connection conn)
Calls toTimestamp to convert internal Oracle Date to a Java Timestamp.
|
Time |
timeValue(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(Connection conn,
Date date)
Convert Java Date to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(Connection conn,
DATE date)
Convert Oracle DATE to Oracle TIMESTAMPTZ
|
static byte[] |
toBytes(Connection conn,
Date date,
Calendar cal)
Convert Java Date to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(Connection conn,
java.time.LocalDateTime ldt)
Convert Java LocalDateTime to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(Connection conn,
String str)
Convert Java String to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(Connection conn,
String str,
Calendar cal)
Convert Java String to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(Connection conn,
Time time)
Convert Java Time to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(Connection conn,
Time time,
Calendar cal)
Convert Java Time to Oracle TIMESTAMPTZ.
|
static byte[] |
toBytes(Connection conn,
Timestamp timestamp)
Convert Java Timestamp to Oracle TIMESTAMPTZ
|
static byte[] |
toBytes(Connection conn,
Timestamp timestamp,
Calendar cal)
Convert Java Timestamp to Oracle TIMESTAMPTZ
|
static byte[] |
toBytes(Connection conn,
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 Date |
toDate(Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Java Date Object
|
static DATE |
toDATE(Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Oracle DATE Object
|
static Date |
toDate2(Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Java Date Object in accordance with java.sql.Date specification.
|
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(Connection conn,
byte[] timestamptz)
Converts a TIMESTAMPTZ to an OffsetDateTime
|
java.time.OffsetTime |
toOffsetTime()
Converts a TIMESTAMPTZ to an OffsetTime
|
static String |
toString(Connection conn,
byte[] timestamptz)
Converts a TIMESTAMPTZ to a string
|
static Time |
toTime(Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Java Time Object
|
static Timestamp |
toTimestamp(Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMP WITH TIME ZONE object to a
Java Timestamp Object
|
static TIMESTAMP |
toTIMESTAMP(Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMPTZ object to a
Oracle TIMESTAMP Object
|
static Timestamp |
toTimestamp2(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, toClass
public TIMESTAMPTZ()
public TIMESTAMPTZ(byte[] timestamptz)
timestamptz
- Oracle TIMESTAMPTZpublic TIMESTAMPTZ(Connection conn, Date date) throws SQLException
conn
- JDBC connection
date Java Date objectSQLException
public TIMESTAMPTZ(Connection conn, Date date, Calendar cal) throws SQLException
conn
- JDBC connection
date Java Date object
cal java Calendar objectSQLException
public TIMESTAMPTZ(Connection conn, Time time) throws SQLException
conn
- JDBC connection
time Java Time objectSQLException
public TIMESTAMPTZ(Connection conn, Time time, Calendar cal) throws SQLException
conn
- JDBC connection
time Java Time object
cal java Calendar objectSQLException
public TIMESTAMPTZ(Connection conn, Timestamp timestamp) throws SQLException
conn
- JDBC connection
timestamp Java Timestamp objectSQLException
public TIMESTAMPTZ(Connection conn, Timestamp timestamp, Calendar cal) throws SQLException
conn
- JDBC connection
timestamp Java Timestamp object
cal Java Calendar objectSQLException
public TIMESTAMPTZ(Connection conn, Timestamp timestamp, java.time.ZoneId tzid) throws SQLException
conn
- JDBC connection
timestamp Java Timestamp object
tzidstamp Java ZoneId objectSQLException
public TIMESTAMPTZ(Connection conn, DATE date) throws SQLException
conn
- JDBC connection
date Oracle DATE objectSQLException
public TIMESTAMPTZ(Connection conn, String str) throws SQLException
conn
- JDBC connection
str Java String objectSQLException
public TIMESTAMPTZ(Connection conn, String str, Calendar cal) throws SQLException
conn
- JDBC connection
str Java String object
cal Calendar object encapsulating the timezoneSQLException
public TIMESTAMPTZ(java.time.OffsetDateTime odt) throws SQLException
odt
- OffsetDateTime objectSQLException
public TIMESTAMPTZ(java.time.ZonedDateTime zdt) throws SQLException
zdt
- ZonedDateTime objectSQLException
public TIMESTAMPTZ(Connection conn, java.time.LocalDateTime ldt) throws SQLException
ldt
- LocalDateTime objectSQLException
public TIMESTAMPTZ(java.time.OffsetTime ot) throws SQLException
ot
- OffsetTime objectSQLException
public static Date toDate(Connection conn, byte[] timestamptz) throws SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ objectSQLException
public static Date toDate2(Connection conn, byte[] timestamptz) throws SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ object in byte arraySQLException
public static Time toTime(Connection conn, byte[] timestamptz) throws SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ objectSQLException
public static DATE toDATE(Connection conn, byte[] timestamptz) throws SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ objectSQLException
public static TIMESTAMP toTIMESTAMP(Connection conn, byte[] timestamptz) throws SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ objectSQLException
public static Timestamp toTimestamp(Connection conn, byte[] timestamptz) throws SQLException
toTimestamp
in interface oracle.jdbc.internal.OracleTimestampWithTimeZone
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ objectSQLException
public static Timestamp toTimestamp2(Connection conn, byte[] timestamptz) throws SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ objectSQLException
public static String toString(Connection conn, byte[] timestamptz) throws SQLException
toString
in interface oracle.jdbc.internal.OracleTimestampWithTimeZone
timestamptz
- a byte arraySQLException
public static java.time.OffsetDateTime toOffsetDateTime(Connection conn, byte[] timestamptz) throws SQLException
timestamptz
- a byte arraySQLException
public Timestamp timestampValue(Connection conn) throws SQLException
SQLException
public byte[] toBytes()
toBytes
in interface oracle.jdbc.internal.OracleTimestampWithTimeZone
public static byte[] toBytes(Connection conn, Date date) throws SQLException
conn
- JDBC connection
date Java Date objectSQLException
public static byte[] toBytes(Connection conn, Date date, Calendar cal) throws SQLException
conn
- JDBC connection
date Java Date object
cal java Calendar objectSQLException
public static byte[] toBytes(Connection conn, Time time) throws SQLException
conn
- JDBC connection
time Java Time objectSQLException
public static byte[] toBytes(Connection conn, Time time, Calendar cal) throws SQLException
conn
- JDBC connection
time Java Time object
cal java Calendar objectSQLException
public static byte[] toBytes(Connection conn, Timestamp timestamp) throws SQLException
conn
- JDBC connection
timestamp Java Timestamp objectSQLException
public static byte[] toBytes(Connection conn, Timestamp timestamp, Calendar cal) throws SQLException
conn
- JDBC connection
timestamp Java Timestamp object
cal Java Calendar objectSQLException
public static byte[] toBytes(Connection conn, Timestamp timestamp, java.time.ZoneId tzid) throws SQLException
conn
- JDBC connection
timestamp Java Timestamp object
tzid Java ZoneId objectSQLException
public static byte[] toBytes(Connection conn, DATE date) throws SQLException
conn
- JDBC connection
date Oracle DATE objectSQLException
public static byte[] toBytes(Connection conn, String str) throws SQLException
toBytes
in interface oracle.jdbc.internal.OracleTimestampWithTimeZone
conn
- JDBC Connection
str java.lang.String object to be converted.SQLException
public static byte[] toBytes(Connection conn, String str, Calendar cal) throws SQLException
conn
- JDBC Connection
str java.lang.String object to be converted.
cal Calendar object encapsulating the timezoneSQLException
public String stringValue(Connection conn) throws SQLException
stringValue
in interface oracle.jdbc.internal.OracleTimestampWithTimeZone
stringValue
in class Datum
conn
- oracle.JDBC.OracleConnection objectSQLException
public static byte[] toBytes(java.time.OffsetDateTime odt) throws SQLException
odt
- OffsetDateTime objectSQLException
public static byte[] toBytes(java.time.ZonedDateTime zdt) throws SQLException
zdt
- ZonedDateTime objectSQLException
public static byte[] toBytes(Connection conn, java.time.LocalDateTime ldt) throws SQLException
zdt
- LocalDateTime objectSQLException
public static byte[] toBytes(java.time.OffsetTime ot) throws SQLException
ot
- OffsetTime objectSQLException
public java.time.OffsetDateTime offsetDateTimeValue(Connection conn) throws SQLException
a
- JDBC Connection objectSQLException
public java.time.ZonedDateTime zonedDateTimeValue() throws SQLException
a
- JDBC Connection objectSQLException
public java.time.LocalDateTime localDateTimeValue() throws SQLException
SQLException
public Date dateValue(Connection conn) throws SQLException
a
- JDBC Connection objectSQLException
public Time timeValue(Connection conn) throws SQLException
SQLException
public TimeZone getTimeZone() throws SQLException
SQLException
public static TIMESTAMPTZ of(java.time.ZonedDateTime zdt) throws SQLException
zdt
- ZonedDateTime objectSQLException
public java.time.ZonedDateTime toZonedDateTime() throws SQLException
SQLException
public java.time.LocalDateTime toLocalDateTime() throws SQLException
SQLException
public static java.time.LocalDateTime toLocalDateTime(byte[] timestamptz) throws SQLException
timestamptz
- TIMESTAMPTZ datumSQLException
public static java.time.ZonedDateTime toZonedDateTime(byte[] timestamptz) throws SQLException
SQLException
public java.time.OffsetTime toOffsetTime() throws SQLException
timestamptz
- a byte arraySQLException
public static TIMESTAMPTZ of(java.time.OffsetDateTime odt) throws SQLException
odt
- OffsetDateTime objectSQLException
public static TIMESTAMPTZ of(Connection conn, java.time.LocalDateTime ldt) throws SQLException
conn
- Connection objectldt
- LocalDateTime objectSQLException
public java.time.OffsetDateTime toOffsetDateTime() throws SQLException
SQLException
public Object toJdbc() throws SQLException
toJdbc
in class Datum
SQLException
- if conversion to JDBC representation results in
an errorpublic Object makeJdbcArray(int arraySize)
makeJdbcArray
in class Datum
arraySize
- size of the arraypublic boolean isConvertibleTo(Class<?> cls)
isConvertibleTo
in class Datum
cls
- Class to convert to