|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.sql.Datum oracle.sql.TIMESTAMPTZ
public class TIMESTAMPTZ
TIMESTAMPTZ Class
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.
Field Summary | |
---|---|
static java.lang.String |
BUILD_DATE
|
static boolean |
TRACE
|
Constructor Summary | |
---|---|
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.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 |
Method Summary | |
---|---|
java.sql.Date |
dateValue(java.sql.Connection conn)
Calls toDate to convert internal Oracle TIMESTAMPTZ to a Java Date. |
boolean |
isConvertibleTo(java.lang.Class cls)
Determines if the object can be converted to a particular class |
java.lang.Object |
makeJdbcArray(int arraySize)
Returns a JDBC array representation of the datum |
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.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 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 |
static java.lang.String |
toString(java.sql.Connection conn,
byte[] timestamptz)
Converts a TIMESTAMP 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)
|
static java.sql.Timestamp |
toTimestamp2(java.sql.Connection conn,
byte[] timestamptz)
Convert a byte array representing a TIMESTAMP object to a Java Timestamp Object |
Methods inherited from class oracle.sql.Datum |
---|
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, byteValue, characterStreamValue, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, longValue, setBytes, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValue |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BUILD_DATE
public static final boolean TRACE
Constructor Detail |
---|
public 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 object
java.sql.SQLException
public 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 object
java.sql.SQLException
public TIMESTAMPTZ(java.sql.Connection conn, java.sql.Time time) throws java.sql.SQLException
conn
- JDBC connection
time Java Time object
java.sql.SQLException
public 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 object
java.sql.SQLException
public TIMESTAMPTZ(java.sql.Connection conn, java.sql.Timestamp timestamp) throws java.sql.SQLException
conn
- JDBC connection
timestamp Java Timestamp object
java.sql.SQLException
public 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 object
java.sql.SQLException
public TIMESTAMPTZ(java.sql.Connection conn, DATE date) throws java.sql.SQLException
conn
- JDBC connection
date Oracle DATE object
java.sql.SQLException
public TIMESTAMPTZ(java.sql.Connection conn, java.lang.String str) throws java.sql.SQLException
conn
- JDBC connection
str Java String object
java.sql.SQLException
public 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 timezone
java.sql.SQLException
Method Detail |
---|
public static java.sql.Date toDate(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ object
java.sql.SQLException
public static java.sql.Date toDate2(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ object in byte array
java.sql.SQLException
public static java.sql.Time toTime(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ object
java.sql.SQLException
public static DATE toDATE(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
conn
- JDBC connection
timestamptz Oracle TIMESTAMPTZ object
java.sql.SQLException
public static TIMESTAMP toTIMESTAMP(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Timestamp toTimestamp(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
conn
- JDBC connection
timestamp Oracle TIMESTAMP object
java.sql.SQLException
public static java.sql.Timestamp toTimestamp2(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
conn
- JDBC connection
timestamp Oracle TIMESTAMP object
java.sql.SQLException
public static java.lang.String toString(java.sql.Connection conn, byte[] timestamptz) throws java.sql.SQLException
timestamptz
- a byte array
java.sql.SQLException
public java.sql.Timestamp timestampValue(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public byte[] toBytes()
public static byte[] toBytes(java.sql.Connection conn, java.sql.Date date) throws java.sql.SQLException
conn
- JDBC connection
date Java Date object
java.sql.SQLException
public 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 object
java.sql.SQLException
public static byte[] toBytes(java.sql.Connection conn, java.sql.Time time) throws java.sql.SQLException
conn
- JDBC connection
time Java Time object
java.sql.SQLException
public 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 object
java.sql.SQLException
public static byte[] toBytes(java.sql.Connection conn, java.sql.Timestamp timestamp) throws java.sql.SQLException
conn
- JDBC connection
timestamp Java Timestamp object
java.sql.SQLException
public 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 object
java.sql.SQLException
public static byte[] toBytes(java.sql.Connection conn, DATE date) throws java.sql.SQLException
conn
- JDBC connection
date Oracle DATE object
java.sql.SQLException
public static byte[] toBytes(java.sql.Connection conn, java.lang.String str) throws java.sql.SQLException
conn
- JDBC Connection
str java.lang.String object to be converted.
java.sql.SQLException
public 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 timezone
java.sql.SQLException
public java.lang.String stringValue(java.sql.Connection conn) throws java.sql.SQLException
stringValue
in class Datum
conn
- oracle.JDBC.OracleConnection object
java.sql.SQLException
public java.sql.Date dateValue(java.sql.Connection conn) throws java.sql.SQLException
a
- JDBC Connection object
java.sql.SQLException
public java.sql.Time timeValue(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public java.lang.Object toJdbc() throws java.sql.SQLException
toJdbc
in class Datum
java.sql.SQLException
- if conversion to JDBC representation results in
an errorpublic java.lang.Object makeJdbcArray(int arraySize)
makeJdbcArray
in class Datum
arraySize
- size of the array
public boolean isConvertibleTo(java.lang.Class cls)
isConvertibleTo
in class Datum
cls
- Class to convert to
|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |