Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

16.12.2 Character code conversion facility

In a Java program, Unicode is used for the character codes. Therefore, the JDBC driver performs mutual character code conversion between the HiRDB character data and the Unicodes. For this character code conversion processing, the JDBC driver uses the encoder and decoder provided by the Java Virtual Machine. At this time, ENCODELANG of Properties info specifies the character set names specified by the JDBC driver for the encoder and decoder that are provided by the Java Virtual Machine.

Tables 16-20 and 16-21 show the correspondences between the HiRDB character codes and the Java character sets.

Table 16-20 Correspondence between HiRDB character codes and Java character sets (UNIX)

HiRDB character codes Character set Remarks
sjis
(Shift JIS kanji)
"SJIS" Double-byte characters include external characters.
ujis
(EUC Japanese kanji)
"EUC_JP"
(Japanese EUC)
Double-byte characters do not include external characters*
chinese
(EUC Chinese kanji)
"EUC_CN"
(Simplified Chinese)
Double-byte characters do not include external characters*
lang-c
(8-bit codes)
"ISO-8859-1"
(ISO Latin-1)
Can be used with US ASCII and 8-bit codes.
UTF-8 UTF-8 None

Note
If ENCODELANG of Properties info is set using the following methods, this setting takes precedence for encoding.
  • Set using Properties info passed as the argument of the DriverManager.getConnection method
  • Set using the JdbhDataSource.setEncodLang method, rce.setEncodLang method, or JdbhXADataSource method
For details about operation when ENCODELANG is not set using the above methods or when OFF is set, see 16.11.5 setEncodeLang.

* You cannot use external character codes assigned to EUC code set 3 (character codes expressed by three bytes in the range of (8F)16 to (XXXX)16.

Table 16-21 Correspondence between HiRDB character codes and Java Character sets (Windows)

HiRDB character codes Character set Remarks
sjis
(Shift JIS kanji)
MS932 when the Java Virtual Machine standard encoding is MS932; otherwise, it is SJIS. Double-byte characters include external characters.
UTF-8 UTF-8 None

Note
If ENCODELANG of Properties info is set using the following methods, this setting takes precedence for encoding:
  • Set using Properties info passed as the argument of the DriverManager.getConnection method
  • Set using the JdbhDataSource.setEncodLang method, JdbhDataSource.setEncodLang method, or JdbhXADataSource method.
For details about operation when ENCODELANG is not set using the above methods or when OFF is set, see 16.11.5 setEncodeLang.