Issue in saving Special charcters in Oracle Database in BLOB datatype
<p>While storing a report generated in CSV file from Java code using hibernate into the column which holds "<strong>BLOB</strong>" data-type in Oracle 11g makes all the special characters converted into <strong>Question Mark(?)</strong>.The character encoding for the Oracle DB is <strong>WE8ISO8859P1</strong>, the character set encoding for the database should be UTF-8 or AL32UTF-8 as far as I know to support all the UTF-8 characters. But since this is an existing application running in production I cannot modify the character set to UTF-8/AL32UTF-8 due to risk factor involved. I have been looking for some solution we may apply from the Java code during save option so that the character set is enforced.
I have tried below code </p>

<pre><code>testReport.setTestReportBlob(new SerialBlob(byteArrayToStore));
</code></pre>

<p>Using Hibernate to store the save the reportBlob object,</p>

<pre><code>getCurrentSession().saveOrUpdate(testReport);
</code></pre>

<p>While we extract the xl from blob data type , it shows special charcters as "?".</p>

<p>below is the piece of code where we are enforcing the character set before setting the byte array to be stored in database </p>

<p><code>fileProcess.setFiledata(exchange.getIn().getBody(String.clas‌​s).getBytes());</code></p>

<p>would setting following properties <code>useUnicode=true&amp;characterEncoding=UTF-8 while getting the connection from the oracle database</code> will that help?Any help or suggestion would be much appreciated. Thanks a lot in advance</p>

<p>PS: I am using toad for oracle as db client.</p>