Hitachi

Hitachi Advanced Database Application Development Guide


7.6.4 Conversion of character encoding

Because Java programs consider the character encoding that is used to be Unicode (UTF-16), the JDBC driver performs bi-directional conversion processing of the character encoding between HADB character string data and Unicode (UTF-16). The JDBC driver uses the encoder provided by the Java Virtual Machine (JVM) for this character encoding conversion processing.

The following figure shows an overview of this bi-directional conversion of character encoding between HADB character string data and Unicode (UTF-16).

Figure 7‒3: Overview of bi-directional conversion of the character encoding between HADB character string data and Unicode (UTF-16)

[Figure]

When the JDBC driver exchanges character string data with HADB, it specifies the character set name to the Java Virtual Machine's (JVM) encoder. This is how the JDBC driver obtains the HADB server's character encoding (Unicode (UTF-8)) and specifies the character set name that corresponds to that encoding.

The following table shows the character set names that correspond to the HADB server's character encoding for specification in the Java Virtual Machine's (JVM) encoder.

Table 7‒15: Names of the character sets supported for the HADB server's character encoding

No.

HADB server's character encoding

(character encoding specified in the ADBLANG environment variable)

Name of the character encoding to be specified in the Java Virtual Machine's (JVM) encoder#

1

Unicode(UTF-8)(UTF8)

UTF-8

2

Shift-JIS(SJIS)

Windows-31j (MS932)

#

The appropriate character set name shown in the table is specified in the Java Virtual Machine's (JVM) encoder after a connection has been established with the HADB server.

Before a connection is established, the Java Virtual Machine's (JVM) default character set is used for converting the character encoding that is used.