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: Ilia <nospam_at_deathtospam.com>
Date: Fri, 11 Jul 2003 19:31:46 GMT
Message-ID: <CgEPa.101793$8B.1629@twister.nyroc.rr.com>


oops, forgot to say that we are running Oracle 8i.

"Ilia" <nospam_at_deathtospam.com> wrote in message news:zsDPa.101359$8B.52664_at_twister.nyroc.rr.com...
> Thank you for your interest, here is more info:
>
> I run java program on Windows XP professional, JVM 1.3.1 with
> a -Dfile.encoding=ISO-8859-1 JVM parameter. Oracle server is running
under
> Linux 7.3.
>
> With this parameter, code
>
> char c = 0x80
> System.out.println(c);
>
> prints out a Euro symbol.
>
> You are right and the range is 0x80-0x9f.
>
> OCI8 driver
>
> NLS_DATABASE_PARAMETERS:
>
> NLS_LANGUAGE AMERICAN
> NLS_TERRITORY AMERICA
> NLS_CURRENCY $
> NLS_ISO_CURRENCY AMERICA
> NLS_NUMERIC_CHARACTERS .,
> NLS_CHARACTERSET WE8ISO8859P1
> NLS_CALENDAR GREGORIAN
> NLS_DATE_FORMAT DD-MON-RR
> NLS_DATE_LANGUAGE AMERICAN
> NLS_SORT BINARY
> NLS_TIME_FORMAT HH.MI.SSXFF AM
> NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
> NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM
> NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZH:TZM
> NLS_DUAL_CURRENCY $
> NLS_COMP BINARY
> NLS_NCHAR_CHARACTERSET WE8ISO8859P1
> NLS_RDBMS_VERSION 8.1.7.0.1
>
>
> "bung ho" <bung_ho_at_hotmail.com> wrote in message
> news:567a1b1.0307101920.615f1999_at_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 Fri Jul 11 2003 - 14:31:46 CDT

Original text of this message

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