Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31219

jdbc locale settings - numeric

From Andreas Leitgeb <avl@auth.logic.tuwien.ac.at>
Newsgroups comp.lang.java.programmer
Subject jdbc locale settings - numeric
Date 2015-02-26 14:44 +0000
Organization A noiseless patient Spider
Message-ID <slrnmeucc9.uoi.avl@login.logic.tuwien.ac.at> (permalink)

Show all headers | View raw


In my (Java) program, I need to open a database (using jdbc),
and send it predefined update statements. They are generated
elsewhere, and I cannot change them.

Some of these predefined statements contain decimal numbers
enclosed in quotes using a "." for the decimal point.

This works all fine for those databases that have appropriate
default settings for "char to numeric" conversion.

Some other databases (on other servers/hosts), however, appear
to expect decimals as "3,1415" with a comma by default.  They
use German locale.

I'm running my head against walls when trying to find out how
to tell the database (at connect time) to use decimal point, 
not decimal comma.

E.g.:
setting property "CLIENT_LOCALE" to "en_US" had no effect,
setting property "DB_LOCALE" to "en_US" caused the connect to
   fail with a message that GL_CTYPE and GL_COLLATE settings
   were incompatible.  (I've already googled the exact message,
   but none of the hits were helpful. If I had the exact wording
   at hand right now, I'd have posted it here)

For date-values and currency values, there are properties to
declare to the server which format is used, but I haven't yet
found a property for number format.

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

jdbc locale settings - numeric Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-02-26 14:44 +0000
  Re: jdbc locale settings - numeric Arne Vajhøj <arne@vajhoej.dk> - 2015-02-26 11:41 -0500
    Re: jdbc locale settings - numeric Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-02-26 19:32 +0000
      Re: jdbc locale settings - numeric Arne Vajhøj <arne@vajhoej.dk> - 2015-02-26 15:47 -0500
  Re: jdbc locale settings - numeric Wayne <nospam@all.invalid> - 2015-02-27 00:29 -0500
    Re: jdbc locale settings - numeric Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-02-27 10:59 +0000
      Re: jdbc locale settings - numeric Wayne <nospam@all.invalid> - 2015-02-27 19:38 -0500
      Re: jdbc locale settings - numeric Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-03-15 00:27 +0000

csiph-web