Question about Oracle BLOBs and encoding

G

GaryM

I am working with a 3rd party application that provides its own
public APIs for accessing its data. Included is an implementation of
a database ResultSet. The object provides a method for getting a
BLOB:

ByteArrayInputstream getBlob(int)

BLOBs are persisted in an Oracle 9i Database as LONG RAW types.

The problem I am encountering is related to the retrieving of a CSV
file using the code below.

ByteArrayInputStream blob = null;
....
get the blob from the db
....
csvFile = new BufferedReader(new InputStreamReader(blob));

In 3 out of 4 implementations this works fine, but in one it returns
garbage. I am told by the DBA that the 4th database is configured
identically to the others.

The content should be US-ASCII but I get mostly non-ASCII back and
actually mentions of "Adobe Photoshop CS Macintosh" in the middle of
it. This makes me think the wrong memory is being read or something.

I have tried creating the InputStreamReader with different named
charsets with no success, so I was hoping someone might have a few
more pointers as to what might be going wrong, or things to check.

Thanks in advance,

Gary
 
C

Chris Uppal

GaryM said:
In 3 out of 4 implementations this works fine, but in one it returns
garbage. I am told by the DBA that the 4th database is configured
identically to the others.

The content should be US-ASCII but I get mostly non-ASCII back and
actually mentions of "Adobe Photoshop CS Macintosh" in the middle of
it. This makes me think the wrong memory is being read or something.

You have checked that the data /in/ the database is OK ?

Might also be worth checking environment settings on both the machine which
issues the query and the one which answers it (assuming they are different
machines).

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,271
Latest member
BuyAtenaLabsCBD

Latest Threads

Top