CLOB not converting 8 bit extended ASCII characters properly on Linux

Hi,

I have few 8 bit extended ASCII characters in database. When I retrieve them using CLOB and convert the CLOB to String then the characters are getting corrupted and I don't see what is stored in database.

It is happening on Linux Environment whereas it is working on Windows Environment. Is there any Linux Environment setting which I need to do.

I am using following to convert CLOB to String

CLOB c_lob = (CLOB) obj;

InputStream ipstream = c_lob.binaryStreamValue();

Where obj is of type oracle.sql.CLOB

[553 byte] By [lily_in_usa] at [2007-11-27 7:34:46]
# 1

There are two steps in your process:

1. Read data from the database into your Java code.

2. Do some unspecified process where you "see" the data.

When debugging problems in that sort of situation, it's a good idea to debug one step at a time, so you can find out which of them is the problem. First things first: is the data read from the database correct? Don't use step 2 to test this because you don't know if it works correctly. Instead, read a known data item that causes the problem and do this to the string:for (int i=0; i<dataitem.length; i++) {

int unicode = (int) dataitem.getCharAt(i);

// display the unicode value somehow

}

Then use the Unicode code charts (available at http://www.unicode.org/) to check the data.

If that's all correct, then start working on step 2. You didn't post any details about that, but that's okay because it likely has nothing to do with JDBC and the database anyway. If you get stuck, post your question about it in the appropriate forum.>

DrClapa at 2007-7-12 19:15:18 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...