Support for globalized error messages

Message text is usually the text of an SQLException object, but can also be an SQLWarn object or any other text output from the driver.

There are two requirements to enable globalized message text output, as follows:
  • You must add the full path of the ifxlang.jar file to the $CLASSPATH (UNIX) or %CLASSPATH% (Windows) environment variable. This JAR file contains globalized versions of all message text supported by Informix® JDBC Driver. Supported languages are English and Chinese.
  • The CLIENT_LOCALE environment variable value must be passed through the property list to the connection object at connection time if you are using a nondefault locale. For more information about CLIENT_LOCALE and GLS features in general, see Support for HCL Informix GLS variables.

Several public classes have constructors that take the current connection object as a parameter so they have access to the CLIENT_LOCALE value. If you want access to non-English error messages, you must use the constructors that include the connection object. Otherwise, any error message text from those classes is in English only. Affected public classes are Interval, IntervalYM, IntervalDF, and IfxLocator. For more information about the constructors to use for these classes, see Work with Informix types.

For an example of how to use the globalized error message support feature, see the locmsg.java program, which is included with Informix® JDBC Driver.