Several JDBC functions were enhanced for i5/OS® Version
5 Release 3.
- UTF-8 and UTF-16 support
- UTF-8 data is stored in a character field with a CCSID of 1208. A UTF-8
character is a variable number of bytes (one, two, three, or four) for a non-combining
character, and any number of bytes for a combining character. The length specified
for a character field is the maximum number of bytes the field can contain.
You can tag the following data types with a UTF-8 1208 CCSID:
- Fixed length character (CHAR)
- Variable length character (VARCHAR)
- Character LOB (CLOB)
UTF-16 data is stored in a graphic field with a CCSID of 1200. A UTF-16
character can be either two or four bytes (that is, Surrogate) in length for
a non-combining character and any number of bytes for a combining character.
The length specified for a graphic data field is the maximum number of two
bytes characters the field can contain. You can tag the following data types
with a UTF-16 1200 CCSID:
- Fixed length graphic (GRAPHIC)
- Variable length graphic (VARGRAPHIC)
- Double-byte character LOB (DBCLOB)
- Binary and Varbinary support
- The BINARY and VARBINARY data types are similar to the CHAR and VARCHAR
data types, but contain binary data rather than character data. BINARY fields
have a fixed length. VARBINARY fields are of varying length. The BINARY and
VARBINARY data types have the following characteristics:
- The coded character set identifier (CCSID) for binary types is 65535
- In assignments and comparisons, binary data types are compatible only
with other binary data types (BINARY, VARBINARY, and BLOB)
- The pad character for binary data types is x'00' instead of the blank
character
- In situations requiring trailing characters to be stripped to prevent
truncation errors, x'00' characters are stripped instead of trailing blanks
- When comparing binary data types, for two fields to be equal both the
data and the lengths must be the same. Trailing zeros are not ignored in comparisons
- When comparing binary data types, if two fields have different lengths,
the shorter field is considered less than the longer field if the fields are
the same up to the length of the shorter field
- Increased Decimal Precision support
- Decimal precision now supports up to 63 digits. Three properties were
added, "minimum divide scale", "maximum precision", and "maximum scale" and
six methods added to AS400JDBCDataSource, setMinimumDivideScale(int divideScale),
getMinimumDivideScale(), setMaximumPrecision(int precision), getMaximumPrecision(),
setMaximumScale(int scale), and getMaximumScale(). Minimum divide scale specifies
the minimum scale value for the result of decimal division and is set to any
number between 0 and 9. Maximum precision specifies the maximum decimal precision
the database uses and is set to either 31 or 63. Maximum scale specifies the
maximum scale the database uses and is set to any number between 0 and 63.
- 2 GB large object (LOB) support
- Enhancements for IBM Toolbox
for Java JDBC
now allow the use of up to 2 GB LOBs support.
- Insensitive cursor support
- Cursor support now supports insensitive cursors. When using a ResultSet
with TYPE_SCROLL_INSENSITIVE, an insensitive cursor is used. The ResultSet
does not show changes to the underlying database while it is open.
- Materialized Query Table support
- Returns "MATERIALIZED QUERY TABLE" as the TABLE_TYPE in a call to DatabaseMetaData.getTables().