
JDBC and HADB Date and Time Operations
■When converting a typed value to a string as the result of the getAsString operation on a NameValueRecord or a QueryResultSet operation
■When parsing a literal value as described in “Literals for 5800 System Data Types” on page 119 to create a typed query value from a string representation of that value.
The Canonical String Decode Operation
The inverse of the canonical string encoding is used in the following places:
■It is always allowed to store a string value into any metadata field, no matter what the type of the field is. The actual data stored is the result of applying the canonical string decode operation to the incoming string value.
■On a virtual view lookup operation, the canonical string decode operation is used on the supplied filename to derive the actual metadata values to look up, given their string representations in the filename.
The decode operation is allowed to accept incoming string values that would never be a legal output for an encode operation. Some examples of this include:
–decodeBinary of an odd number of hex digits. The convention is to
–decodeDate of a
–A double value encoded with a
.00145E20 instead of 1.45E17.
EXAMPLE
If you take a value V and encode it into a string S, and then perform the canonical decode operation on S to get a new value V’. Does V always equal V’? The answer is yes in most cases, but not always.
What is actually guaranteed is the weaker statement that if encode(V) = S and if decode(S)=V’, then encode(V’) is also equal to S.
JDBC and HADB Date and Time Operations
■Use the 5800 system literal format for all the Date and Time operations, for example, {date
■The JDBC standard escape sequences for date ({d
’hh:mm:ss’}) literals are available. However, usage of JDBC format date and time literals may produce inconsistent results. In particular, when JDBC format is used, the literal format is interpreted as being relative to the local time zone, and the time zone usually differs between a 5800 system cluster and client machine.
120 | Sun StorageTek 5800 System Client API Reference Manual • June 2008 |