Home | Previous Page | Next Page   Internationalization and Date Formats >

User-Defined Locales

IBM Informix JDBC Driver uses the JDK internationalization API to manipulate international data. The classes and methods in this API take a JDK locale or encoding as a parameter, but because the Informix DB_LOCALE and CLIENT_LOCALE properties specify the locale and code set based on Informix names, these Informix names are mapped to the JDK names. These mappings are kept in internal tables, which are updated periodically.

For example, the Informix and JDK names for the ASCII code set are 8859-1 and 8859_1, respectively. IBM Informix JDBC Driver maps 8859-1 to 8859_1 in its internal tables and uses the appropriate JDK name in the JDK classes and methods.

Because new locales may be created between updates of these tables, two new connection properties, NEWLOCALE and NEWCODESET, let you specify a locale or code set that is not specified in the tables. Here is an example URL using these properties:

jdbc:informix-sqli://myhost:1533:informixserver=myserver;
   user=myname; password=mypasswd;NEWLOCALE=en_us,en_us;
   NEWCODESET=8859_1,8859-1,819;

A URL must be on one line.

The NEWLOCALE and NEWCODESET properties have the following formats:

NEWLOCALE=JDK-locale,Ifx-locale:JDK-locale,Ifx-locale...

NEWCODESET=JDK-encoding,Ifx-codeset,Ifx-codeset-number:JDK-
   encoding, Ifx-codeset,Ifx-codeset-number...

There is no limit to the number of locale or code-set mappings you can specify.

If you specify an incorrect number of parameters or values, you get a Locale Not Supported or Encoding or Code Set Not Supported message.

If these properties are set in the URL or a DataSource object, the new values in NEWLOCALE and NEWCODESET override the values in the JDBC internal tables. For example, if JDBC already maps 8859-1 to 8859_1 internally, but you specify NEWCODESET=8888,8859-1,819 instead, the new value 8888 is used for the code-set conversion.

To support connecting to NLS databases, IBM informix JDBC Driver maintains a table mapping NLS locale to the corresponding JDK locale and JDK codeset. As JDK support for more locales and codesets becomes available, an NLS locale not previously supported can be supported with newer JDKs. IBM Informix JDBC Driver supports a connection property, NEWNLSMAP, which lets you specify mappings for an NLS locale that is not specified in the tables.

The NEWNLSMAP property has the following format:

NEWNLSMAP=NLS-locale,JDK-locale,JDK-codeset:NLS-locale,JDK-locale,
JDK-codeset,....

Here is an example URL using these properties:

jdbc:informix-sqli://myhost:1533:informixserver=myserver;
user=myname;password=mypasswd;NEWNLSMAP=rumanian,ro_RO,ISO8859_2;

There is no limit to the number of mappings you can specify. If you specify an incorrect number of parameters or values, you get a Locale Not Supported or Encoding or Code Set Not Supported message.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]