|
Oracle® Database JDBC Java API Reference 11g Release 2 ("11.2.0.0.1-Beta-1") BETA E13995-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
oracle.sql.Datum
oracle.sql.TIMESTAMP
public class TIMESTAMP
TIMESTAMP Class
The TIMESTAMP 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
8 Nanoseconds
9 Nanoseconds
10 Nanoseconds
Static methods are used for conversions.
| Field Summary | |
|---|---|
static java.lang.String |
BUILD_DATE |
static boolean |
PRIVATE_TRACE |
static boolean |
TRACE |
| Constructor Summary | |
|---|---|
TIMESTAMP()Constructs a TIMESTAMP object initialized to 1/1/1970. |
|
TIMESTAMP(byte[] timestamp)Create an Oracle TIMESTAMP object represented by the given Oracle Timestamp |
|
TIMESTAMP(java.sql.Date date)Create an Oracle TIMESTAMP object represented by the java Date |
|
TIMESTAMP(DATE date)Create an Oracle TIMESTAMP object represented by the Oracle date |
|
TIMESTAMP(java.lang.String str)Create a TIMESTAMP object given a Java String object. |
|
TIMESTAMP(java.sql.Time time)Create an Oracle TIMESTAMP object represented by the given java Time |
|
TIMESTAMP(java.sql.Timestamp timestamp)Create an Oracle TIMESTAMP object represented by the java Timestamp |
|
TIMESTAMP(java.sql.Timestamp timestamp, java.util.Calendar cal)Create an Oracle TIMESTAMP object represented by the java Timestamp and Calendar |
|
| Method Summary | |
|---|---|
java.sql.Date |
dateValue()Calls toDate to convert internal Oracle TIMESTAMP 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()Calls toString to convert internal Oracle TIMESTAMP to a Java String. |
java.sql.Timestamp |
timestampValue()Calls toTimestamp to convert internal Oracle Date to a Java Timestamp. |
java.sql.Timestamp |
timestampValue(java.util.Calendar cal)Calls toTimestamp to convert internal Oracle Date and Calendar to a Java Timestamp. |
java.sql.Time |
timeValue()Calls toTime to convert internal Oracle Date to a Java Time. |
static TIMESTAMP |
TimeZoneConvert(java.sql.Connection conn, TIMESTAMP tstamp, java.util.TimeZone tz1, java.util.TimeZone tz2)Converts the TIMESTAMP object from one timezone to the other |
byte[] |
toBytes()Convert Oracle Timestamp object into a byte array |
static byte[] |
toBytes(java.sql.Date date)Convert Java Date to Oracle TIMESTAMP. |
static byte[] |
toBytes(DATE date)Convert Oracle DATE to Oracle Timestamp |
static byte[] |
toBytes(java.lang.String str)Convert Java String to Oracle TIMESTAMP. |
static byte[] |
toBytes(java.sql.Time time)Convert Java Time to Oracle TIMESTAMP. |
static byte[] |
toBytes(java.sql.Timestamp timestamp)Convert Java Timestamp to Oracle Timestamp |
static byte[] |
toBytes(java.sql.Timestamp timestamp, java.util.Calendar cal)Convert Java Timestamp and Java Calendar to Oracle Timestamp |
static java.sql.Date |
toDate(byte[] timestamp)Convert a byte array representing a TIMESTAMP object to a Java Date Object |
static DATE |
toDATE(byte[] timestamp)Convert a byte array representing a TIMESTAMP object to a Oracle Date Object |
java.lang.Object |
toJdbc()Returns the JDBC representation of the datum object |
static java.lang.String |
toString(byte[] timestamp)Converts a TIMESTAMP to a string |
static java.sql.Time |
toTime(byte[] timestamp)Convert a byte array representing a TIMESTAMP object to a Java Time Object |
static java.sql.Timestamp |
toTimestamp(byte[] timestamp)Convert a byte array representing a TIMESTAMP object to a Java Timestamp Object |
static java.sql.Timestamp |
toTimestamp(byte[] timestamp, java.util.Calendar cal)Convert a byte array representing a TIMESTAMP object to a Java Timestamp Object given Calendar object |
| Methods inherited from class oracle.sql.Datum |
|---|
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, byteValue, characterStreamValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, longValue, setBytes, setShareBytes, shareBytes |
| 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
public static final boolean PRIVATE_TRACE
| Constructor Detail |
|---|
public TIMESTAMP()
public TIMESTAMP(byte[] timestamp)
timestamp - Oracle TIMESTAMPpublic TIMESTAMP(java.sql.Time time)
time - Java Time objectpublic TIMESTAMP(java.sql.Date date)
date - Java Date objectpublic TIMESTAMP(java.sql.Timestamp timestamp)
timestamp - Java Timestamp object
public TIMESTAMP(java.sql.Timestamp timestamp,
java.util.Calendar cal)
timestamp - Java Timestamp objectcal - Java Util Calendar objectpublic TIMESTAMP(DATE date)
date - Oracle DATE objectpublic TIMESTAMP(java.lang.String str)
str - Java String object| Method Detail |
|---|
public static java.sql.Date toDate(byte[] timestamp)
throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Time toTime(byte[] timestamp)
throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Timestamp toTimestamp(byte[] timestamp)
throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Timestamp toTimestamp(byte[] timestamp,
java.util.Calendar cal)
throws java.sql.SQLException
timestamp - Oracle TIMESTAMP object to be convertedcal - java.utl.Calendar objectjava.sql.SQLException
public static DATE toDATE(byte[] timestamp)
throws java.sql.SQLException
java.sql.SQLException
public java.sql.Timestamp timestampValue()
throws java.sql.SQLException
timestampValue in class Datumjava.sql.SQLException
public java.sql.Timestamp timestampValue(java.util.Calendar cal)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.lang.String toString(byte[] timestamp)
date - a byte arraypublic byte[] toBytes()
public static byte[] toBytes(java.sql.Time time)
time - java.sql.Time object to be converted.public static byte[] toBytes(java.sql.Date date)
date - java.sql.Date object to be converted.public static byte[] toBytes(java.sql.Timestamp timestamp)
Timestamp - java.sql.Timestamp object to be converted.
public static byte[] toBytes(java.sql.Timestamp timestamp,
java.util.Calendar cal)
Timestamp - java.sql.Timestamp object to be converted.Calendar - java.util.Calendar object to be converted.public static byte[] toBytes(DATE date)
date - oracle.sql.Timestamp object to be converted.public static byte[] toBytes(java.lang.String str)
str - java.lang.String object to be converted.
public java.lang.Object toJdbc()
throws java.sql.SQLException
toJdbc in class Datumjava.sql.SQLException - if conversion to JDBC representation results in an errorpublic 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
public static TIMESTAMP TimeZoneConvert(java.sql.Connection conn,
TIMESTAMP tstamp,
java.util.TimeZone tz1,
java.util.TimeZone tz2)
throws java.sql.SQLException
conn - Java Connection object tstamp TIMESTAMP object to be converted tz1 Source timezone tz2 Destination timezonejava.sql.SQLExceptionpublic java.lang.String stringValue()
stringValue in class Datum
public java.sql.Date dateValue()
throws java.sql.SQLException
dateValue in class Datumjava.sql.SQLException
public java.sql.Time timeValue()
throws java.sql.SQLException
timeValue in class Datumjava.sql.SQLException
|
Oracle® Database JDBC Java API Reference 11g Release 2 ("11.2.0.0.1-Beta-1") BETA E13995-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||