Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Locale

 
smitha rai
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gurus,

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

Thanks,

Smitha
 
M Beck
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Layne
 
M Beck
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic