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 -> Oracle Clob and characters from 0x80-0xa0 (128-160)

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

From: Ilia <nospam_at_deathtospam.com>
Date: Thu, 10 Jul 2003 20:39:16 GMT
Message-ID: <U9kPa.28370$EQ5.22193@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. Received on Thu Jul 10 2003 - 15:39:16 CDT

Original text of this message

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