I have an xml file in Oracle database's CLOB column. I am trying to fetch it, parse it using JDOM, and update one of the elements with Chinese characters which come from my web page. The database charset is AL32UTF8.
Following is the steps io follow. 1. Select data using getAsciiStream() of result set. 2. SAXBulder to build it. 3. Update one of the elements with Chinese. 4. Get the string using XMLOutputer. 5. Call getBytes of the string. 6. Update the Column using setAsciiStream of PreparedStatement.
But i always get error saying "Invalid character encountered in: failAL32UTF8Conv"
can I recommend you at least consider not putting XML in the database? Our experience was that since it is not easily searchable and loses the XML provided context that we had to go back and create an XML to table mapping. This also works well with automatic Object-Relational-XML layers and takes much of the effort away.
Originally posted by Jeanne Boyarsky: Mahesh, If it's a Chinese character, it wouldn't be Ascii. Right?
Yes its not ascii. In fact i tried using setCharacterStream and getCharacterStream methods also. The javadoc says, it reads as Unicode stream. Anyway i think i'll go with David's suggestion. If you get more info on this, please post it.