Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Clob and characters from 0x80-0xa0 (128-160)

Re: Oracle Clob and characters from 0x80-0xa0 (128-160)

From: bung ho <bung_ho_at_hotmail.com>
Date: 10 Jul 2003 20:20:32 -0700
Message-ID: <567a1b1.0307101920.615f1999@posting.google.com>


"Ilia" <nospam_at_deathtospam.com> wrote in message news:<U9kPa.28370$EQ5.22193_at_twister.nyroc.rr.com>...
> I need to store all possible 256 characters in the DB using JDBC. All works
> well when I use VARCHAR2 (I needed to set -Dfile.encoding=ISO-8859-1
> parameter on the JVM). I can store values using resultSet.setString() and
> retrieve using resultSet.getString().
>
> The problem is that I need to store values longer than 4000 bytes. I
> converted the column type to Clob and things broke:
>
> I set the value using preparedStatement.setString() and it is stored
> correctly in the database (I verified it using Toad). But when I use this
> code to get the values, characters in the range 0x80-0xa0 come back as 253
> instead:
>
> Clob clob = resultSet.getClob(1);
> String val = clob.getSubString(1, len);
>
> I've tried all methods on Clob and CLOB but everything I tried screwes up
> these characters. Please help!!
>
> Thanks.

what platform is your client on (the machine that runs the java and prints out your String val). are you sure this has to do with oracle, since you say that it gets inserted correctly one way or the other? in the following java snippet:

      char c = 0x80;
      System.out.println(c);

on windows, this code will print a ? when executed. since unicode from 128-255 uses ISO-8859-1, and 128-159 are control characters in ISO-8859-1, they will look busted in Cp1252 (windows default), which don't have those control characters. what characters are you expecting to see?

ps, are you sure it's 0x80-0xa0, and not 0x80-9f (i.e., 128-159)? Received on Thu Jul 10 2003 - 22:20:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US