Localizing Cloudscape
Page 2 of 5

Database Locale

Cloudscape databases vary their behavior according to locales in the following ways:

  • Database error messages are in the language of the locale, if support is explicitly provided for that locale with a special library.

    For example, Cloudscape explicitly supports Spanish-language error messages. If a database's locale is set to one of the Spanish-language locales, Cloudscape returns error messages in the Spanish language.

    Localized messages require special libraries. See Messages Libraries.

  • Special data types called international string data types sort according to the locale, follow locale usage for the built-in functions LOWER and UPPER, and provide localized display of converted date/time data types.

    For example, in a Norwegian locale, `aa' sorts after `z'.

    For more information, see International String Data Types in the Cloudscape Reference Manual.

Setting a Database's Locale

You set the locale for a database when you create it, or in the case of databases created prior to Version 3.5, when you upgrade it. After the database is created or upgraded to a post-3.0 version, you cannot change a database's locale.

If you do not explicitly specify a locale, Cloudscape uses the locale of your machine, which is automatically detected by your JVM (the value returned by java.lang.Locale.getDefault.)

To override the default locale, explicitly set the locale using the locale attribute on the database connection URL when you create or upgrade the database.

You specify the locale with a two-lowercase-letter code for the language, followed by an underscore (_), followed by a two-uppercase-letter code for the country. Examples and more details are provided in locale=ll_CC in the Cloudscape Reference Manual.

Some example database connection URLs:

jdbc:cloudscape:germanDB;create=true;locale=de_DE
jdbc:cloudscape:japaneseDB;upgrade=true;locale=ja_JP

NOTE: In synchronized systems, you cannot set the locale of a target to be different than the locale of the source. When upgrading Version 3.5 source databases, targets inherit the new locale on the first refresh.

Finding Out a Database's Locale

COM.cloudscape.database.Database has a method called getLocale that returns the locale of the database. Within an SQL-J statement:

VALUES Factory.getDatabaseOfSystem().getLocale()