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., java. or java..
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static final Date | Returns: Date translated from buffer with specified encodingencoding of buffer data encoding)Expected character representation is DERBY string representation of a date,
which is in JIS format: |
| pack-priv static final Timestamp | Returns: Timestamp translated from buffer with specified encodingencoding of buffer encoding)Expected character representation is DERBY string representation of a date
which is in JIS format: |
| public static final int | Returns: DateTime.dateRepresentationLength. This is the fixed length in bytes taken to represent the date valuebytes in UTF8 encoding of the date buffer, int write into the buffer from this offset offset, DateTimeValue date value date)Date is converted to a char representation in JDBC date format: |
| private static Calendar | getCleanCalendar(Calendar
Calendar object to use if non-null. recyclableCal)Return a clean (i.e. all values cleared out) Calendar object that can be used for creating Time, Timestamp, and Date objects. |
| public static int | Returns: the timestamp lengthtrue if the connection supports nanoseconds in timestamps supportsTimestampNanoseconds)Return the length of a timestamp depending on whether timestamps should have full nanosecond precision or be truncated to just microseconds. |
| private static int | Returns: The nanoseconds field as parsed from the timestamp string. This cannot be set in the Calendar object but we still want to preserve the value, in case the caller needs it (for example, to create a java.sql.Timestamp with nanosecond precision).Timestamp value to parse, as a String. timestamp, Calendar Calendar into which to store the parsed fields. Should not be null. cal, boolean true if the server supports nanoseconds in timestamps supportsTimestampNanoseconds)Parse a String of the form |
| pack-priv static final Time | Returns: Time translated from buffer with specified encodingencoding of buffer encoding)Expected character representation is DERBY string representation of time,
which is in the format: |
| pack-priv static final Timestamp | Returns: Timestamp translated from buffer with specified encodingencoding of buffer encoding)Expected character representation is DERBY string representation of time
which is in the format: |
| pack-priv static final Date | Returns: Date translated from buffer with specified encodingencoding of buffer encoding)See getTimestampLength() for an explanation of how timestamps are formatted. |
| pack-priv static final Time | Returns: Time translated from buffer with specified Encodingencoding of buffer encoding)See getTimestampLength() for an explanation of how timestamps are formatted. |
| pack-priv static final Timestamp | Returns: TimeStamp translated from buffer with specified encodingencoding of buffer encoding, boolean true if the server supports nanoseconds in timestamps supportsTimestampNanoseconds)See getTimestampLength() for an explanation of how timestamps are formatted. |
| public static final int | Returns: DateTime.timestampRepresentationLength. This is the fixed length in bytes, taken to represent the timestamp valuebytes in UTF8 encoding of the timestamp buffer, int write into the buffer from this offset offset, DateTimeValue timestamp value timestamp, boolean true if the server supports nanoseconds in timestamps supportsTimestampNanoseconds)See getTimestampLength() for an explanation of how timestamps are formatted. |
| public static final int | Returns: DateTime.timeRepresentationLength. This is the fixed length in bytes taken to represent the time valuebytes in UTF8 encoding of the time buffer, int write into the buffer from this offset offset, DateTimeValue java.sql.Time value time)java.sql.Time is converted to character representation which is in JDBC time escape
format: |
| dateRepresentationLength | back to summary |
|---|---|
| private static final int dateRepresentationLength | |
| timeRepresentationLength | back to summary |
|---|---|
| private static final int timeRepresentationLength | |
| timestampRepresentationLength | back to summary |
|---|---|
| private static final int timestampRepresentationLength | |
| DateTime | back to summary |
|---|---|
| private DateTime() | |
| dateBytesToDate | back to summary |
|---|---|
| pack-priv static final Date dateBytesToDate(byte[] buffer, int offset, Calendar recyclableCal, Charset encoding) Expected character representation is DERBY string representation of a date,
which is in JIS format: | |
| dateBytesToTimestamp | back to summary |
|---|---|
| pack-priv static final Timestamp dateBytesToTimestamp(byte[] buffer, int offset, Calendar recyclableCal, Charset encoding) Expected character representation is DERBY string representation of a date
which is in JIS format: | |
| dateToDateBytes | back to summary |
|---|---|
| public static final int dateToDateBytes(byte[] buffer, int offset, DateTimeValue date) throws SqlException Date is converted to a char representation in JDBC date format:
| |
| getCleanCalendar | back to summary |
|---|---|
| private static Calendar getCleanCalendar(Calendar recyclableCal) Return a clean (i.e. all values cleared out) Calendar object that can be used for creating Time, Timestamp, and Date objects. If the received Calendar object is non-null, then just clear that and return it.
| |
| getTimestampLength | back to summary |
|---|---|
| public static int getTimestampLength(boolean supportsTimestampNanoseconds) Return the length of a timestamp depending on whether timestamps
should have full nanosecond precision or be truncated to just microseconds.
java.sql.Timestamp is converted to a character representation which is a DERBY string
representation of a timestamp converted to bytes using UTF8 encoding.
For Derby 10.6 and above, this is
| |
| parseTimestampString | back to summary |
|---|---|
| private static int parseTimestampString(String timestamp, Calendar cal, boolean supportsTimestampNanoseconds) Parse a String of the form
| |
| timeBytesToTime | back to summary |
|---|---|
| pack-priv static final Time timeBytesToTime(byte[] buffer, int offset, Calendar recyclableCal, Charset encoding) Expected character representation is DERBY string representation of time,
which is in the format: | |
| timeBytesToTimestamp | back to summary |
|---|---|
| pack-priv static final Timestamp timeBytesToTimestamp(byte[] buffer, int offset, Calendar recyclableCal, Charset encoding) Expected character representation is DERBY string representation of time
which is in the format: | |
| timestampBytesToDate | back to summary |
|---|---|
| pack-priv static final Date timestampBytesToDate(byte[] buffer, int offset, Calendar recyclableCal, Charset encoding) See getTimestampLength() for an explanation of how timestamps are formatted. | |
| timestampBytesToTime | back to summary |
|---|---|
| pack-priv static final Time timestampBytesToTime(byte[] buffer, int offset, Calendar recyclableCal, Charset encoding) See getTimestampLength() for an explanation of how timestamps are formatted. | |
| timestampBytesToTimestamp | back to summary |
|---|---|
| pack-priv static final Timestamp timestampBytesToTimestamp(byte[] buffer, int offset, Calendar recyclableCal, Charset encoding, boolean supportsTimestampNanoseconds) See getTimestampLength() for an explanation of how timestamps are formatted. | |
| timestampToTimestampBytes | back to summary |
|---|---|
| public static final int timestampToTimestampBytes(byte[] buffer, int offset, DateTimeValue timestamp, boolean supportsTimestampNanoseconds) throws SqlException See getTimestampLength() for an explanation of how timestamps are formatted.
| |
| timeToTimeBytes | back to summary |
|---|---|
| public static final int timeToTimeBytes(byte[] buffer, int offset, DateTimeValue time) java.sql.Time is converted to character representation which is in JDBC time escape
format:
| |