Neoview JDBC Type 4 Driver Programmer's Reference (R2.2, R2.3, R2.4, R2.5)

Internationalization Support
“When String Literals Are Used in Applications” (page 31)
“Controlling String Literal Conversion by Using the Character-Set Properties” (page 31)
“Localizing Error Messages and Status Messages” (page 32)
When String Literals Are Used in Applications
Internationalization support in the driver affects the handling of string literals. The Type 4 driver
handles string literals in two situations.
When the driver processes an SQL statement. For example,
Statement stmt = conection.getStatement();
stmt.execute(select * from table1 where col1 = abcd’”);
When the driver processes JDBC parameters. For example,
PreparedStatement pStmt = connection.prepareStatement(select * from table1
where col1 = ?);
pStmt.setString(1, abcd);
To convert a string literal from the Java to an array of bytes for processing by the Neoview SQL
database, the Type 4 driver uses the column type in the database.
Controlling String Literal Conversion by Using the Character-Set Properties
The Type 4 driver provides character-set mapping properties. These properties allow you to
explicitly define the translation of internal Neoview SQL database character-set formats to and
from the Java string Unicode (UnicodeBigUnmarked) encoding.
The Type 4 driver provides character-set mapping properties through key values as shown in
Table 3-1.
Table 3-1 JDBC Type 4 Driver Character-Set Mapping
Default ValueKey
ISO88591_1ISO88591
SJISKANJI
EUC_KRKSC5601
A description of these character sets appears in Table 3-2, which summarizes the character sets
supported by the Neoview SQL database.
Table 3-2 Corresponding Neoview Character Sets and Java Encoding Sets
Description
Corresponding Java Encoding
Set—Canonical Name for java.io and
java.lang API
Neoview
Character Set
Single-character, 8-bit character set for character-data
type. ISO88591 supports English and other Western
European languages.
ISO88591_1ISO88591
For detailed information, see “ISO88591 Property” (page 42).
Using the Character-Set Properties
The java.sql.PreparedStatement class contains the methods setString() and
setCharacterStream(). These methods take a String and Reader parameter, respectively.
The java.sql.ResultSet class contains the methods getString() and getCharacterStream().
These methods return a String and Reader, respectively.
Internationalization Support 31