public class TIMESTAMPLTZ extends Datum
The TIMESTAMPLTZ
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 eleven 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)-We add 100 to the century and decade fields so that negative values will be positive and positive values will be higher than negative values -We add 1 to the month,hour,minute,second fields for the java objects since they start of from 0.
Static methods are used for conversions.
ojiOracleDatumWithConnection, targetDatum
Constructor and Description |
---|
TIMESTAMPLTZ()
Constructs a TIMESTAMPLTZ object initialized to 1/1/1970.
|
TIMESTAMPLTZ(byte[] timestampltz)
Create an Oracle TIMESTAMPLTZ object represented by the given
Oracle Timestampltz
|
TIMESTAMPLTZ(Connection conn,
Calendar sess,
Date date)
Create an Oracle TIMESTAMPLTZ object represented by the Java Date
|
TIMESTAMPLTZ(Connection conn,
Calendar sess,
DATE date)
Create an Oracle TIMESTAMPLTZ object represented by the Oracle DATE
|
TIMESTAMPLTZ(Connection conn,
Calendar sess,
String str)
Deprecated.
|
TIMESTAMPLTZ(Connection conn,
Calendar sess,
Time time)
Create an Oracle TIMESTAMPLTZ object represented by the given Java Time
|
TIMESTAMPLTZ(Connection conn,
Calendar sess,
Timestamp timestamp)
Create an Oracle TIMESTAMPLTZ object represented by the Java Timestamp
|
TIMESTAMPLTZ(Connection conn,
Date date)
Create an Oracle TIMESTAMPLTZ object represented by the Java Date
|
TIMESTAMPLTZ(Connection conn,
DATE date)
Create an Oracle TIMESTAMPLTZ object represented by the Oracle DATE
|
TIMESTAMPLTZ(Connection conn,
Date date,
Calendar dbtz)
Deprecated.
|
TIMESTAMPLTZ(Connection conn,
DATE date,
Calendar dbtz)
Deprecated.
|
TIMESTAMPLTZ(Connection conn,
java.time.LocalDateTime ldt)
Create an Oracle TIMESTAMPLTZ object represented by the LocalDateTime
|
TIMESTAMPLTZ(Connection conn,
java.time.OffsetDateTime odt)
Create an Oracle TIMESTAMPLTZ object represented by the OffsetDateTime
|
TIMESTAMPLTZ(Connection conn,
java.time.OffsetTime ot)
Create an Oracle TIMESTAMPLTZ object represented by the OffsetTime
|
TIMESTAMPLTZ(Connection conn,
String str)
Deprecated.
|
TIMESTAMPLTZ(Connection conn,
String str,
Calendar dbtz)
Deprecated.
|
TIMESTAMPLTZ(Connection conn,
Time time)
Create an Oracle TIMESTAMPLTZ object represented by the given Java Time
|
TIMESTAMPLTZ(Connection conn,
Time time,
Calendar dbtz)
Deprecated.
|
TIMESTAMPLTZ(Connection conn,
Timestamp timestamp)
Create an Oracle TIMESTAMPLTZ object represented by the Java Timestamp
|
TIMESTAMPLTZ(Connection conn,
Timestamp timestamp,
Calendar dbtz)
Deprecated.
|
TIMESTAMPLTZ(Connection conn,
java.time.ZonedDateTime zdt)
Create an Oracle TIMESTAMPLTZ object represented by the ZonedDateTime
|
Modifier and Type | Method and Description |
---|---|
Date |
dateValue(Connection conn)
Calls toDate(Connection, byte[]) to convert internal Oracle
TIMESTAMPLTZ to a Java Date.
|
Date |
dateValue(Connection conn,
Calendar cal)
Calls toDate(Connection, byte[], Calendar) to convert internal Oracle
TIMESTAMPLTZ to a Java Date.
|
boolean |
isConvertibleTo(Class<?> cls)
Determines if the object can be converted to a particular class
|
java.time.LocalDateTime |
localDateTimeValue(Connection conn)
Calls toLocalDateTime(Connection, byte[]) to convert internal Oracle
TIMESTAMPLTZ to a Java LocalDateTime.
|
Object |
makeJdbcArray(int arraySize)
Returns a JDBC array representation of the datum
|
static TIMESTAMPLTZ |
of(Connection conn,
java.time.LocalDateTime ldt)
Creates TIMESTAMPLTZ from the LocalDateTime.
|
static TIMESTAMPLTZ |
of(Connection conn,
java.time.OffsetDateTime odt)
Creates TIMESTAMPLTZ from the OffsetDateTime.
|
static TIMESTAMPLTZ |
of(Connection conn,
java.time.OffsetTime ot)
Creates TIMESTAMPLTZ from the OffsetTime.
|
static TIMESTAMPLTZ |
of(Connection conn,
java.time.ZonedDateTime zdt)
Creates TIMESTAMPLTZ from the ZonedDateTime.
|
java.time.OffsetDateTime |
offsetDateTimeValue(Connection conn)
Calls toOffsetDateTime(Connection, byte[]) to convert internal Oracle
TIMESTAMPLTZ to a Java OffsetDateTime.
|
java.time.OffsetTime |
offsetTimeValue(Connection conn)
Calls toOffsetTime(Connection, byte[]) to convert internal Oracle
TIMESTAMPLTZ to a Java OffsetTime.
|
String |
stringValue(Connection conn)
Calls toString(Connection, byte[]) to convert internal Oracle
TIMESTAMPLTZ to a Java String.
|
String |
stringValue(Connection conn,
Calendar cal)
Calls toString(Connection, byte[], Calendar) to convert internal Oracle
TIMESTAMPLTZ to a Java String.
|
Timestamp |
timestampValue(Connection conn) |
Timestamp |
timestampValue(Connection conn,
Calendar dbtz)
Calls toTimestamp to convert internal Oracle TIMESTAMPLTZ
to a Java Timestamp.
|
Time |
timeValue(Connection conn)
Calls toTime to convert internal Oracle TIMESTAMPLTZ to a Java Time.
|
Time |
timeValue(Connection conn,
Calendar cal)
Calls toTime to convert internal Oracle TIMESTAMPLTZ to a Java Time.
|
static void |
TimeZoneAdjust(Connection conn,
Calendar cal1,
Calendar cal2) |
static long |
TimeZoneAdjustUTC(Connection conn,
Calendar cal1) |
byte[] |
toBytes()
Convert Oracle TIMESTAMPLTZ object into a byte array
|
static byte[] |
toBytes(Connection conn,
Calendar cal,
Date date)
Convert Java Date to Oracle TIMESTAMPLTZ.
|
static byte[] |
toBytes(Connection conn,
Calendar cal,
DATE date)
Convert Oracle DATE to Oracle TIMESTAMPLTZ
|
static byte[] |
toBytes(Connection conn,
Calendar sess,
String str)
Convert Java String to Oracle TIMESTAMPLTZ.
|
static byte[] |
toBytes(Connection conn,
Calendar cal,
Time time)
Convert Java Time to Oracle TIMESTAMPLTZ.
|
static byte[] |
toBytes(Connection conn,
Calendar cal,
Timestamp timestamp)
Convert Java Timestamp to Oracle TIMESTAMPLTZ
|
static byte[] |
toBytes(Connection conn,
Date date,
Calendar dbtz)
Deprecated.
|
static byte[] |
toBytes(Connection conn,
DATE date,
Calendar dbtz)
Deprecated.
|
static byte[] |
toBytes(Connection conn,
java.time.LocalDateTime ldt)
Convert Java LocalDateTime to Oracle TIMESTAMPLTZ.
|
static byte[] |
toBytes(Connection conn,
java.time.OffsetDateTime odt)
Convert Java OffsetDateTime to Oracle TIMESTAMPLTZ.
|
static byte[] |
toBytes(Connection conn,
java.time.OffsetTime ot)
Convert Java OffsetTime to Oracle TIMESTAMPLTZ.
|
static byte[] |
toBytes(Connection conn,
String str,
Calendar dbtz)
Convert Java String to Oracle TIMESTAMPLTZ.
|
static byte[] |
toBytes(Connection conn,
Time time,
Calendar dbtz)
Deprecated.
|
static byte[] |
toBytes(Connection conn,
Timestamp timestamp,
Calendar dbtz)
Deprecated.
|
static byte[] |
toBytes(Connection conn,
java.time.ZonedDateTime zdt)
Convert Java ZonedDateTime to Oracle TIMESTAMPLTZ.
|
static Date |
toDate(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Java Date Object
|
static DATE |
toDATE(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Oracle DATE Object
|
static Date |
toDate(Connection conn,
byte[] timestampltz,
Calendar dbtz)
Deprecated.
|
static DATE |
toDATE(Connection conn,
byte[] timestampltz,
Calendar dbtz)
Deprecated.
|
Object |
toJdbc()
Returns the JDBC representation of the datum object
|
java.time.LocalDateTime |
toLocalDateTime(Connection conn)
Convert a byte array representing a TIMESTAMPLTZ object to a
Java LocalDateTime Object
|
static java.time.LocalDateTime |
toLocalDateTime(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Java LocalDateTime Object
|
static java.time.OffsetDateTime |
toOffsetDateTime(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Java OffsetDateTime Object
|
static java.time.OffsetTime |
toOffsetTime(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Java OffsetTime Object
|
static String |
toString(Connection conn,
byte[] timestampltz)
Converts a TIMESTAMPLTZ to a string
|
static String |
toString(Connection conn,
byte[] timestampltz,
Calendar dbtz)
Deprecated.
|
static Time |
toTime(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Java Time Object
|
static Time |
toTime(Connection conn,
byte[] timestampltz,
Calendar dbtz)
Deprecated.
|
static Timestamp |
toTimestamp(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Java Timestamp Object
|
static TIMESTAMP |
toTIMESTAMP(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Oracle TIMESTAMP Object
|
static Timestamp |
toTimestamp(Connection conn,
byte[] timestampltz,
Calendar dbtz)
Deprecated.
|
static TIMESTAMPTZ |
toTIMESTAMPTZ(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Oracle TIMESTAMPTZ Object
|
static java.time.ZonedDateTime |
toZonedDateTime(Connection conn,
byte[] timestampltz)
Convert a byte array representing a TIMESTAMPLTZ object to a
Java ZonedDateTime Object
|
java.time.ZonedDateTime |
zonedDateTimeValue(Connection conn)
Calls toZonedDateTime(Connection, byte[]) to convert internal Oracle
TIMESTAMPLTZ 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 TIMESTAMPLTZ()
public TIMESTAMPLTZ(byte[] timestampltz)
Connection
- connpublic TIMESTAMPLTZ(Connection conn, Time time, Calendar dbtz) throws SQLException
conn
- JDBC connection
time Java Time object
dbtz Calendar object containing Database TimezoneSQLException
public TIMESTAMPLTZ(Connection conn, Date date, Calendar dbtz) throws SQLException
conn
- JDBC connection
date Java Date object
dbtz Calendar object containing Database TimezoneSQLException
public TIMESTAMPLTZ(Connection conn, Timestamp timestamp, Calendar dbtz) throws SQLException
conn
- Connection
timestamp Java Timestamp object
dbtz Calendar object containing Database TimezoneSQLException
public TIMESTAMPLTZ(Connection conn, DATE date, Calendar dbtz) throws SQLException
conn
- JDBC connection
date Oracle DATE object
dbtz Calendar object containing Database TimezoneSQLException
public TIMESTAMPLTZ(Connection conn, String str, Calendar dbtz) throws SQLException
conn
- JDBC connection
str Java String object
dbtz Calendar object containing Database TimezoneSQLException
public TIMESTAMPLTZ(Connection conn, Calendar sess, Time time) throws SQLException
conn
- JDBC connection
sess Calendar object containing Session Timezone
time Java Time objectSQLException
public TIMESTAMPLTZ(Connection conn, Calendar sess, Date date) throws SQLException
conn
- JDBC connection
sess Calendar object containing Session Timezone
date Java Date objectSQLException
public TIMESTAMPLTZ(Connection conn, Calendar sess, Timestamp timestamp) throws SQLException
conn
- Connection
sess Calendar object containing Session Timezone
timestamp Java Timestamp objectSQLException
public TIMESTAMPLTZ(Connection conn, Calendar sess, DATE date) throws SQLException
conn
- JDBC connection
sess Calendar object containing Session Timezone
date Oracle DATE objectSQLException
public TIMESTAMPLTZ(Connection conn, Calendar sess, String str) throws SQLException
conn
- JDBC connection
sess Calendar object containing Session Timezone
str Java String objectSQLException
public TIMESTAMPLTZ(Connection conn, Time time) throws SQLException
conn
- JDBC connection
time Java Time objectSQLException
public TIMESTAMPLTZ(Connection conn, Date date) throws SQLException
conn
- JDBC connection
date Java Date objectSQLException
public TIMESTAMPLTZ(Connection conn, Timestamp timestamp) throws SQLException
conn
- Connection
timestamp Java Timestamp objectSQLException
public TIMESTAMPLTZ(Connection conn, DATE date) throws SQLException
conn
- JDBC connection
date Oracle DATE objectSQLException
public TIMESTAMPLTZ(Connection conn, String str) throws SQLException
conn
- JDBC connection
str Java String objectSQLException
public TIMESTAMPLTZ(Connection conn, java.time.OffsetDateTime odt) throws SQLException
conn
- JDBC connection
odt OffsetDateTime objectSQLException
public TIMESTAMPLTZ(Connection conn, java.time.OffsetTime ot) throws SQLException
conn
- JDBC connection
ot OffsetTime objectSQLException
public TIMESTAMPLTZ(Connection conn, java.time.ZonedDateTime zdt) throws SQLException
conn
- JDBC connection
zdt ZonedDateTime objectSQLException
public TIMESTAMPLTZ(Connection conn, java.time.LocalDateTime ldt) throws SQLException
conn
- JDBC connection
ldt LocalDateTime objectSQLException
public static Date toDate(Connection conn, byte[] timestampltz, Calendar dbtz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ object
dbtz Database timezoneSQLException
public static Time toTime(Connection conn, byte[] timestampltz, Calendar dbtz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ object
dbtz Database timezoneSQLException
public static Timestamp toTimestamp(Connection conn, byte[] timestampltz, Calendar dbtz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ object
dbtz Database timezoneSQLException
public static DATE toDATE(Connection conn, byte[] timestampltz, Calendar dbtz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ object
dbtz Database timezoneSQLException
public Timestamp timestampValue(Connection conn, Calendar dbtz) throws SQLException
SQLException
public Timestamp timestampValue(Connection conn) throws SQLException
SQLException
public static String toString(Connection conn, byte[] timestampltz, Calendar dbtz) throws SQLException
date
- a byte arraySQLException
public byte[] toBytes()
public static byte[] toBytes(Connection conn, Time time, Calendar dbtz) throws SQLException
conn
- JDBC connection
time java.sql.Time object to be converted.
dbtz Database timezoneSQLException
public static byte[] toBytes(Connection conn, Date date, Calendar dbtz) throws SQLException
conn
- JDBC connection
date java.sql.Date object to be converted.
dbtz Database timezoneSQLException
public static byte[] toBytes(Connection conn, Timestamp timestamp, Calendar dbtz) throws SQLException
conn
- JDBC connection
Timestamp java.sql.Timestamp object to be converted.
dbtz database timezoneSQLException
public static byte[] toBytes(Connection conn, DATE date, Calendar dbtz) throws SQLException
conn
- JDBC connection
date oracle.sql.DATE object to be converted.
dbtz database timezoneSQLException
public static byte[] toBytes(Connection conn, String str, Calendar dbtz) throws SQLException
conn
- JDBC Connection
str java.lang.String object to be converted.
dbtz database timezoneSQLException
public static Date toDate(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ objectSQLException
public java.time.LocalDateTime toLocalDateTime(Connection conn) throws SQLException
conn
- JDBC connectionSQLException
public static java.time.LocalDateTime toLocalDateTime(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ objectSQLException
public static TIMESTAMPLTZ of(Connection conn, java.time.OffsetDateTime odt) throws SQLException
odt
- OffsetDateTime objectSQLException
public static TIMESTAMPLTZ of(Connection conn, java.time.OffsetTime ot) throws SQLException
ot
- OffsetTime objectSQLException
public static TIMESTAMPLTZ of(Connection conn, java.time.ZonedDateTime zdt) throws SQLException
zdt
- ZonedDateTime objectSQLException
public static TIMESTAMPLTZ of(Connection conn, java.time.LocalDateTime ldt) throws SQLException
ldt
- LocalDateTime objectSQLException
public static java.time.OffsetDateTime toOffsetDateTime(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ objectSQLException
public static java.time.OffsetTime toOffsetTime(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ objectSQLException
public static java.time.ZonedDateTime toZonedDateTime(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ objectSQLException
public static Time toTime(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ objectSQLException
public static Timestamp toTimestamp(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestamp Oracle TIMESTAMP objectSQLException
public static DATE toDATE(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestampltz Oracle TIMESTAMPLTZ objectSQLException
public static TIMESTAMP toTIMESTAMP(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestamp Oracle TIMESTAMPLTZ objectSQLException
public static TIMESTAMPTZ toTIMESTAMPTZ(Connection conn, byte[] timestampltz) throws SQLException
conn
- JDBC connection
timestamp Oracle TIMESTAMPLTZ objectSQLException
public static String toString(Connection conn, byte[] timestampltz) throws SQLException
date
- a byte arraySQLException
public static byte[] toBytes(Connection conn, Calendar cal, Time time) throws SQLException
conn
- JDBC connection
cal Session timezone
time java.sql.Time object to be converted.SQLException
public static byte[] toBytes(Connection conn, Calendar cal, Date date) throws SQLException
conn
- JDBC connection
cal Session timezone
date java.sql.Date object to be converted.SQLException
public static byte[] toBytes(Connection conn, Calendar cal, Timestamp timestamp) throws SQLException
conn
- JDBC connection
cal Session timezone
Timestamp java.sql.Timestamp object to be converted.SQLException
public static byte[] toBytes(Connection conn, Calendar cal, DATE date) throws SQLException
conn
- JDBC connection
cal Session timezone
date oracle.sql.DATE object to be converted.SQLException
public static byte[] toBytes(Connection conn, Calendar sess, String str) throws SQLException
conn
- JDBC Connection
sess Calendar object containing Session Timezone
str java.lang.String object to be converted.SQLException
public static byte[] toBytes(Connection conn, java.time.OffsetTime ot) throws SQLException
conn
- JDBC Connection
odt OffsetTime objectSQLException
public static byte[] toBytes(Connection conn, java.time.ZonedDateTime zdt) throws SQLException
conn
- JDBC Connection
zdt ZonedDateTime objectSQLException
public static byte[] toBytes(Connection conn, java.time.OffsetDateTime odt) throws SQLException
conn
- JDBC Connection
odt OffsetDateTime objectSQLException
public static byte[] toBytes(Connection conn, java.time.LocalDateTime ldt) throws SQLException
conn
- JDBC Connection
ldt LocalDateTime objectSQLException
public String stringValue(Connection conn) throws SQLException
stringValue
in class Datum
conn
- oracle.JDBC.OracleConnection objectSQLException
public String stringValue(Connection conn, Calendar cal) throws SQLException
conn
- oracle.JDBC.OracleConnection object
cal java.util.Calendar objectSQLException
public Date dateValue(Connection conn, Calendar cal) throws SQLException
conn
- JDBC Connection object
cal java.util.Calendar objectSQLException
public Date dateValue(Connection conn) throws SQLException
conn
- JDBC Connection objectSQLException
public java.time.LocalDateTime localDateTimeValue(Connection conn) throws SQLException
conn
- JDBC Connection objectSQLException
public java.time.OffsetDateTime offsetDateTimeValue(Connection conn) throws SQLException
conn
- JDBC Connection objectSQLException
public java.time.OffsetTime offsetTimeValue(Connection conn) throws SQLException
conn
- JDBC Connection objectSQLException
public java.time.ZonedDateTime zonedDateTimeValue(Connection conn) throws SQLException
conn
- JDBC Connection objectSQLException
public Time timeValue(Connection conn) throws SQLException
SQLException
public Time timeValue(Connection conn, Calendar cal) 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 topublic static void TimeZoneAdjust(Connection conn, Calendar cal1, Calendar cal2) throws SQLException
SQLException
public static long TimeZoneAdjustUTC(Connection conn, Calendar cal1) throws SQLException
SQLException