Specifications
• data-codec: affects STRING and BINARY data fields when retrieved as a string.
The codecs established with the connect() function are used for all Statement instances derived
from the DataSource during the connection. However the Statement.getString() function allows
overriding the data-codec on an individual field basis.
Text items exchanged with the database
EncodingDirectionText itemFunction
query-codecTo databaseuser name and passwordconnect()
query-codecTo databaseSQL statementexecute()
query-codecFrom databaseTable namestables()
query-codecTo databaseTable namecolumns()
query-codecFrom databaseColumn names
query-codecFrom databaseColumn namegetColumnName()
getColumnDataType()
getColumnSize()
query-codecFrom databaseColumn namegetNumber() getDate()
getString() getBinary()
data-codecFrom databaseData fieldgetString() for STRING
and BINARY data types
Default behaviour
The default query-codec and data-codec is UTF-16.
If the data-codec for the connection is UTF-16, the default codec for converting BINARY column
data is latin-1 (copy the low byte and clear the high byte of each code point).
If the data-codec for the connection is an 8-bit encoding (i.e. not UTF-16), that encoding is also
the default for converting BINARY column data.
The default behavior is summarized in the following table.
Algorithm to determine codecItem
If DataSource.connect() explicitly specifies a query-codec, use that codec.
Otherwise use UTF-16
query-codec
If Statement.getString() explicitly specifies a data-codec, use that code.
If DataSource.connect() explicitly specifies a data-codec, use that codec.
Otherwise use UTF-16
data-codec for STRING
data in
Statement.getString()
If Statement.getString() explicitly specifies a data-codec, use that codec
(even if the specified codec is UTF-16). If DataSource.connect() explicitly
data-codec for BINARY
data in
Statement.getString()
439
Enfocus Switch 10