Re: Arrrgh! Where is the method to set encoding to insert into a table?
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET, Java & JDBC Development, Internationalization & Character Sets
Hi, If you are using the JDBC-ODBC driver provided by SUN, you can use one of the following two solutions: 1 Set the value of system property "file.encoding" to the name of some encoding scheme which will not lose information while converting your java char sequence into byte sequence and vice versa. For example, "GB2312", if you are using simplified Chinese, or "UTF-8". 2 Use the method public static Connection getConnection(String url, Properties info) to get your JDBC connection. Specify the value of property "charSet" as the name of some suitable encoding scheme(as discussed in 1), in the 'Properties' parameter. ZHU In a previous article, "Vincent Chan" <pchan@csis.hku.hk> writes: >Hi Carlos, > > I am facing the same problem. Some experts said that the jdbc:odbc >bridge will only send the lower 8bit to the database. Thus, the chinese or >japanese characters will change to ??. However, I am not sure it is true or >not. What kind of jdbc driver are you using? Jdbc:Odbc bridge or some jdbc >natvie driver? > > I have put an example in this location: >http://hw518b.csis.hku.hk/ednet/servlets/ChineseForm and the code is placed >at http://hw518b.csis.hku.hk/ChineseForm.txt > > I'm going crazy with this too! > >Vincent > > ----- Posted via NewsOne.Net: Free Usenet News via the Web ----- ----- http://newsone.net/ -- Discussions on every subject. ----- NewsOne.Net prohibits users from posting spam. If this or other posts made through NewsOne.Net violate posting guidelines, email abuse@newsone.net