Oracle® Globalization Development Kit Java API Reference
10g Release 1 (

Part No. B10971-02

Class DBLocaleSource

All Implemented Interfaces:

public class DBLocaleSource
extends LocaleSource

The DBLocaleSource class is the predefined database locale source that accesses a user profile table including user locale preferences. All user profile information can be specified in the GDK application configuration file.

The database locale source should use the special tag <db-locale-source> to include the user profile information in the list of the locale determination rule. The following attributes are required:

The attributes for the locale must be specified in one of the following parameters depending on the scenario:

Scenario 1: If the user locale preference is stored in the form of ISO locale, use:

Scenario 2: If the user locale preference is stored in the form of Oracle language and Oracle territory names, use:

Scenario 3: If the user locale preference is stored in the form of Oracle abbreviation language and territory names, use:

Additionally, the following attributes may need to be specified:

For example, assuming the user locale and time zone preferences are used for globalized operations, the user schema table is specified as follows:

 create table user_profile
   userid varchar2(100) primary key, -- user id
   ... (various user information)
   locale  varchar2(10), -- user locale preference, e.g., ja-JP
   timezone varchar2(50) -- user time zone preference, e.g., America/Los_Angeles

The data source file has the following connection information:

 <data-source class="com.evermind.sql.DriverManagerDataSource" 
   password="<db password>"

The locale determination rule would become the following:


Also, the application provides the authentication filter that specifies "userinfo" to either the user id or null in the session object so that the database locale source object can determine if the user is authenticated or not.

See Also:
Serialized Form

Nested Class Summary

Nested classes inherited from class oracle.i18n.servlet.localesource.LocaleSource
LocaleSource.Alignment, LocaleSource.Parameter, LocaleSource.WritingDirection

Methods inherited from class oracle.i18n.servlet.localesource.LocaleSource
equals, getAttribute, getCharacterSet, getCollator, getCurrencyFormat, getDateFormat, getDateTimeFormat, getISOCurrency, getLocale, getLocaleSourceClass, getNumberFormat, getTimeFormat, getTimeZone, getWritingDirection, hashCode, isCached, isReadOnly, load, setAttribute, setCharacterSet, setCollator, setCurrencyFormat, setDateFormat, setDateTimeFormat, setISOCurrency, setLocale, setLocale, setLocaleSourceClass, setNumberFormat, setTimeFormat, setTimeZone, setWritingDirection, store

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Oracle® Globalization Development Kit Java API Reference
10g Release 1 (

Part No. B10971-02

Copyright © 2003, 2004, Oracle. All rights reserved.