• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle JDBC driver problem on Canada locale

 
David Chen
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, there:

I have problem on Oracle JDBC thin driver with Canada locale on client side:
I'm using Oracle9i thin jdbc driver, the nls parameters in oracle database is:
NLS_LANGUAGE: AMERICAN
NLS_TERRITORY: AMERICA
NLS_NUMERIC_CHARACTERS : .,

My java client side is running on Windows NT, which using jdbc thin driver to connect oracle database. If I set the locale in client side as "English(Canada)", it seems return me "French" number format, like ",45" (comma, instead of decimal point) for "0.45". However, If I set client side locale as "English(United States)", it returns me "0.45" as expected.
So, my question: does Oracle JDBC driver always returns "French" number format evenif I set "English(Canada)" as locale? Because Canada have both English and French locale "French(Canada), and English(Canada)". How can I get "English" number format like "0.45" with "English(Canada)" locale setting?

Really appreciated any reply, and thanks a lot in advance

David
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"DavidChen",
We're pleased to have you here with us in the JDBC forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

Your name is really close. Just missing a space.

Thanks,
Jeanne
Forum Bartender
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes there is support for NLS....
download the nls_charset12.zip from oracle and read some iplementaion of It.
here is the link

http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html
 
David Chen
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Shailesh, I added nls_charset12.zip with classes12.zip, however, I got the same problem.
In client side, if I set locale as en_US, the value of NLS_NUMERIC_CHARACTERS is ".," which is right, however if I set locale as en_CA, the value of NLS_NUMERIC_CHARACTERS is ", " which is not right.
Also, if I get the result by string (getString() ), and using NumberFormat to parse the String ( ex ",45"), it will raise the exception if I set locale as en_CA for NumberFormat, but works fine if I set locale as Canada_French for NumberFormat. So, I just guess, it's a bug in oracle jdbc driver, which returns French number format for en_CA locale.
Thanks in advance if anyone have any idea on this problem

Thanks a lot
David
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic