Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle Clob and characters from 0x80-0xa0 (128-160)
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