File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Locale Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Locale" Watch "Locale" New topic


smitha rai
Ranch Hand

Joined: Aug 15, 2001
Posts: 33
Hi Gurus,

What is locale and how it is used while retrieving the data from the database?


M Beck
Ranch Hand

Joined: Jan 14, 2005
Posts: 323
which database, on what operating system?

the only "locale" i'm familiar with is a feature of Unix-like OSes. it's used to select appropriate localizations of things like currency formats, time formats, sorting sequences, and so on; specifically, it's used by the shared C library, and other libraries which depend on it. non-C languages often (but not always) have to go to a little extra trouble to utilize the locale specifications - i do not know how, or even whether, they are available from Java. (i've never written a program that had to be localized, namely, in any language.)

as for why any of this should impact data being retrieved from a database, i really can't imagine. maybe some databases do this by default, but that would surprise me - i can see too many ways for such behaviour to mess up the data, when the purpose of a database is to make sure the data is not messed up.
[ February 08, 2005: Message edited by: M Beck ]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
The concept of locale is not limited to Unix-like operating systems. Windows uses it as well. As stated above, it typically includes information for formatting date, time, or currency information. For example, in the United States, dates are typically in the "mm/dd/yyyy" format. However, some parts of the world use "dd/mm/yyyy". This means that the date "02/09/2005" can be either Feburary 9th 2005 or September 2nd 2005, depending on the current locale settings.

Java provides the java.util.Locale class to ease the burder of "localizing" code when these differences matter.


Java API Documentation
The Java Tutorial
M Beck
Ranch Hand

Joined: Jan 14, 2005
Posts: 323
oh, i knew windows has a similar concept, but i wasn't sure if the same term was used to describe it. thanks for clearing that up for me.
I agree. Here's the link:
subject: Locale
jQuery in Action, 3rd edition