SQL/MX Programming Manual for Java
SQLJ Programming
HP NonStop SQL/MX Programming Manual for Java—523726-003
3-40
Character String Data Types
Character String Data Types
This subsection describes:
•
Character String Truncation on page 3-40
•
Character Sets on page 3-40
•
Assigning Character String Data to an Output Host Variable on page 3-41
•
Assigning (or Comparing) Character String Data to an SQL Column on page 3-42
Character String Truncation
Host variables declared with the java.lang.String type are not constrained to a
user-defined, fixed-length maximum as character string variables in other host
languages.
For input to the database, the String data is truncated if necessary to the length of
the SQL column. If truncation is necessary, JDBC issues a warning.
For output from the database, the String host variable is dynamically sized to
whatever size is necessary to hold the selected data.
Character Sets
A character set is a group of characters that build one or more languages and that
have an internal numeric encoding.
Java host variables declared as java.lang.String or java.lang.Byte accept
character string data from SQL columns of any character set. Internally, Java handles
character string data in Unicode character-set format.
You can assign Java host variables to and compare them with an SQL column of a
compatible character set. SQL/MX supports these character sets in SQL columns that
have character string data types:
•
ISO88591 (SQL/MP and SQL/MX tables)
•
UCS2 (SQL/MX tables only)
•
KANJI (SQL/MP tables only)
•
KSC5601 (SQL/MP tables only)
•
National character set (typically UCS2 in SQL/MX; KANJI or KSC5601 in SQL/MP)
For more information about these characters sets, see the SQL/MX Reference Manual.