Hi, I have folloing problem: i get a string form keybord into a language( not english) greek,arabic etc but when i insert it into a Oracle Database and i want to see what i have inserted i only got supid chars. I used nls_charset12,zip,classes12.zip i am disperate please help thx
Joined: Jan 07, 1999
"dreamonb", The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements. Thanks.
You must also make sure that the value of NLS_LANG is correctly set for the database scheme you are using. Manually, such as when using SQL*Plus, this can be set per session, by executing: <code> ALTER SESSION SET NLS_LANGUAGE='ICELANDIC'; ALTER SESSION SET NLS_TERRITORY='ICELAND'; </code> or whatever region/language you want to use. For a JDBC application using the OCI driver, setting the environment variable NLS_LANG before the application is started should be enough. For example, on UNIX: <code> export NLS_LANG=American_America.we8iso8859p1 </code> When using the JDBC Thin driver, another approach is necessary. The Thin driver obtains language and territory settings (<code>NLS_LANGUAGE and NLS_TERRITORY</code>) from the Java locale in the JVM <code>user.language property</code>. This can be set by supplying a parameter when the Java program/application server is started: <code> java -Duser.language=ICELANDIC ... [specify Java class] </code> More information on this topic is available at http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/ java.817/a83724/advanc1.htm#1001170. Cheers, Bjarki Holm Author of Professional Java Data
[This message has been edited by Bjarki Holm (edited June 12, 2001).]
Joined: Jun 11, 2001
I solved the problem other way : Before i sent data to JDBC i used a conversion from Greek to iso i used .. String sum=new String(bla.getBytes(),"ISO-8859-1"); and when i retrieved from database i converted it again in greek with mychar2=new String(rs.getBytes(1),"ISO-8859-7"); thx anyway for the tip