| java.lang.Object org.apache.derby.client.am.DateTime
DateTime | public class DateTime (Code) | | High performance converters from date/time byte encodings to JDBC Date, Time and Timestamp objects.
Using this class for direct date/time conversions from bytes offers superior performance over the alternative method
of first constructing a Java String from the encoded bytes, and then using
java.sql.Date.valueOfjava.sql.Date.valueOf() ,
java.sql.Time.valueOf java.sql.Time.valueOf() or
java.sql.Timestamp.valueOfjava.sql.Timestamp.valueOf() .
|
Method Summary | |
final public static java.sql.Date | dateBytesToDate(byte[] buffer, int offset, java.sql.Date recyclableDate, String encoding) | final public static java.sql.Timestamp | dateBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding) | final public static int | dateToDateBytes(byte[] buffer, int offset, java.sql.Date date) Date is converted to a char representation in JDBC date format: yyyy-mm-dd date format
and then converted to bytes using UTF8 encoding
Parameters: buffer - bytes in UTF8 encoding of the date Parameters: offset - write into the buffer from this offset Parameters: date - date value DateTime.dateRepresentationLength. | final public static int | dateToTimestampBytes(byte[] buffer, int offset, java.sql.Date date) java.sql.Date is converted to character representation that is in DERBY string
representation of a timestamp:yyyy-mm-dd-hh.mm.ss.ffffff and then
converted to bytes using UTF8 encoding and written out to the buffer
Parameters: buffer - Parameters: offset - offset in buffer to start writing to Parameters: date - date value DateTime.timestampRepresentationLength. | final public static java.sql.Time | timeBytesToTime(byte[] buffer, int offset, java.sql.Time recyclableTime, String encoding) | final public static java.sql.Timestamp | timeBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding) | final public static int | timeToTimeBytes(byte[] buffer, int offset, java.sql.Time time) java.sql.Time is converted to character representation which is in JDBC time escape
format: hh:mm:ss , which is the same as JIS time format in DERBY string
representation of a time. | final public static int | timeToTimestampBytes(byte[] buffer, int offset, java.sql.Time time) | final public static java.sql.Date | timestampBytesToDate(byte[] buffer, int offset, java.sql.Date recyclableDate, String encoding) Expected character representation is DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff . | final public static java.sql.Time | timestampBytesToTime(byte[] buffer, int offset, java.sql.Time recyclableTime, String encoding) Expected character representation is DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff . | final public static java.sql.Timestamp | timestampBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding) Expected character representation is DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff . | final public static int | timestampToDateBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) java.sql.Timestamp is converted to character representation that is in JDBC date escape
format: yyyy-mm-dd , which is the same as JIS date format in DERBY string representation of a date.
and then converted to bytes using UTF8 encoding.
Parameters: buffer - Parameters: offset - write into the buffer from this offset Parameters: timestamp - timestamp value DateTime.dateRepresentationLength. | final public static int | timestampToTimeBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) java.sql.Timestamp is converted to character representation in JDBC time escape format:
hh:mm:ss , which is the same as
JIS time format in DERBY string representation of a time. | final public static int | timestampToTimestampBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) java.sql.Timestamp is converted to a character representation which is in DERBY string
representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff .
and then converted to bytes using UTF8 encoding
Parameters: buffer - bytes in UTF8 encoding of the timestamp Parameters: offset - write into the buffer from this offset Parameters: timestamp - timestamp value DateTime.timestampRepresentationLength. |
dateBytesToDate | final public static java.sql.Date dateBytesToDate(byte[] buffer, int offset, java.sql.Date recyclableDate, String encoding) throws UnsupportedEncodingException(Code) | | Expected character representation is DERBY string representation of a date,
which is in JIS format: yyyy-mm-dd
Parameters: buffer - Parameters: offset - Parameters: recyclableDate - Parameters: encoding - encoding of buffer data Date translated from buffer with specified encoding throws: UnsupportedEncodingException - |
dateBytesToTimestamp | final public static java.sql.Timestamp dateBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding) throws UnsupportedEncodingException(Code) | | Expected character representation is DERBY string representation of a date
which is in JIS format: yyyy-mm-dd
Parameters: buffer - Parameters: offset - Parameters: recyclableTimestamp - Parameters: encoding - encoding of buffer Timestamp translated from buffer with specified encoding throws: UnsupportedEncodingException - |
dateToDateBytes | final public static int dateToDateBytes(byte[] buffer, int offset, java.sql.Date date) throws SqlException, UnsupportedEncodingException(Code) | | Date is converted to a char representation in JDBC date format: yyyy-mm-dd date format
and then converted to bytes using UTF8 encoding
Parameters: buffer - bytes in UTF8 encoding of the date Parameters: offset - write into the buffer from this offset Parameters: date - date value DateTime.dateRepresentationLength. This is the fixed length in bytes taken to represent the date value throws: SqlException - throws: UnsupportedEncodingException - if UTF8 Encoding is not supported |
dateToTimestampBytes | final public static int dateToTimestampBytes(byte[] buffer, int offset, java.sql.Date date) throws SqlException, UnsupportedEncodingException(Code) | | java.sql.Date is converted to character representation that is in DERBY string
representation of a timestamp:yyyy-mm-dd-hh.mm.ss.ffffff and then
converted to bytes using UTF8 encoding and written out to the buffer
Parameters: buffer - Parameters: offset - offset in buffer to start writing to Parameters: date - date value DateTime.timestampRepresentationLength. This is the fixed lengthin bytes, taken to represent the timestamp value. throws: SqlException - throws: UnsupportedEncodingException - |
timeBytesToTime | final public static java.sql.Time timeBytesToTime(byte[] buffer, int offset, java.sql.Time recyclableTime, String encoding) throws UnsupportedEncodingException(Code) | | Expected character representation is DERBY string representation of time,
which is in the format: hh.mm.ss
Parameters: buffer - Parameters: offset - Parameters: recyclableTime - Parameters: encoding - encoding of buffer Time translated from buffer with specified encoding throws: UnsupportedEncodingException - |
timeBytesToTimestamp | final public static java.sql.Timestamp timeBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding) throws UnsupportedEncodingException(Code) | | Expected character representation is DERBY string representation of time
which is in the format: hh.mm.ss
Parameters: buffer - Parameters: offset - Parameters: recyclableTimestamp - Parameters: encoding - encoding of buffer Timestamp translated from buffer with specified encoding throws: UnsupportedEncodingException - |
timeToTimeBytes | final public static int timeToTimeBytes(byte[] buffer, int offset, java.sql.Time time) throws UnsupportedEncodingException(Code) | | java.sql.Time is converted to character representation which is in JDBC time escape
format: hh:mm:ss , which is the same as JIS time format in DERBY string
representation of a time. The char representation is converted to bytes using UTF8
encoding.
Parameters: buffer - bytes in UTF8 encoding of the time Parameters: offset - write into the buffer from this offset Parameters: time - java.sql.Time value DateTime.timeRepresentationLength. This is the fixed length in bytes taken to represent the time value throws: UnsupportedEncodingException - |
timeToTimestampBytes | final public static int timeToTimestampBytes(byte[] buffer, int offset, java.sql.Time time) throws UnsupportedEncodingException(Code) | | java.sql.Time is converted to a character representation that is in DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff and converted to bytes using UTF8 encoding
Parameters: buffer - Parameters: offset - offset in buffer to start writing to Parameters: time - time value DateTime.timestampRepresentationLength which is the fixed lengthtaken up by the conversion of time to timestamp in bytes throws: UnsupportedEncodingException - |
timestampBytesToDate | final public static java.sql.Date timestampBytesToDate(byte[] buffer, int offset, java.sql.Date recyclableDate, String encoding) throws UnsupportedEncodingException(Code) | | Expected character representation is DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff .
Parameters: buffer - Parameters: offset - Parameters: recyclableDate - Parameters: encoding - encoding of buffer Date translated from buffer with specified encoding throws: UnsupportedEncodingException - |
timestampBytesToTime | final public static java.sql.Time timestampBytesToTime(byte[] buffer, int offset, java.sql.Time recyclableTime, String encoding) throws UnsupportedEncodingException(Code) | | Expected character representation is DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff .
Parameters: buffer - Parameters: offset - Parameters: recyclableTime - Parameters: encoding - encoding of buffer Time translated from buffer with specified Encoding throws: UnsupportedEncodingException - |
timestampBytesToTimestamp | final public static java.sql.Timestamp timestampBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding) throws UnsupportedEncodingException(Code) | | Expected character representation is DERBY string representation of a timestamp:
yyyy-mm-dd-hh.mm.ss.ffffff .
Parameters: buffer - Parameters: offset - Parameters: recyclableTimestamp - Parameters: encoding - encoding of buffer TimeStamp translated from buffer with specified encoding throws: UnsupportedEncodingException - |
timestampToDateBytes | final public static int timestampToDateBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws SqlException, UnsupportedEncodingException(Code) | | java.sql.Timestamp is converted to character representation that is in JDBC date escape
format: yyyy-mm-dd , which is the same as JIS date format in DERBY string representation of a date.
and then converted to bytes using UTF8 encoding.
Parameters: buffer - Parameters: offset - write into the buffer from this offset Parameters: timestamp - timestamp value DateTime.dateRepresentationLength. This is the fixed length in bytes, that is taken to represent the timestamp value as a date. throws: SqlException - throws: UnsupportedEncodingException - |
timestampToTimeBytes | final public static int timestampToTimeBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws UnsupportedEncodingException(Code) | | java.sql.Timestamp is converted to character representation in JDBC time escape format:
hh:mm:ss , which is the same as
JIS time format in DERBY string representation of a time. The char representation is
then converted to bytes using UTF8 encoding and written out into the buffer
Parameters: buffer - Parameters: offset - write into the buffer from this offset Parameters: timestamp - timestamp value DateTime.timeRepresentationLength. This is the fixed length in bytes taken to represent the timestamp value as Time. throws: UnsupportedEncodingException - |
timestampToTimestampBytes | final public static int timestampToTimestampBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws SqlException, UnsupportedEncodingException(Code) | | java.sql.Timestamp is converted to a character representation which is in DERBY string
representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff .
and then converted to bytes using UTF8 encoding
Parameters: buffer - bytes in UTF8 encoding of the timestamp Parameters: offset - write into the buffer from this offset Parameters: timestamp - timestamp value DateTime.timestampRepresentationLength. This is the fixed length in bytes, taken to represent the timestamp value throws: SqlException - throws: UnsupportedEncodingException - |
|
|