Reputation: 173
We have a a table which stores XMLs as CLOB (Oracle 10g).
These XMLs typically contains some special characters
e.g `FDEAÂ’s`
When I query this record using SQLDeveloper and save the XML in notepad as UTF8 encoding, the special characters appear.
But when I am trying to query the same through JDBC, I get either ? or blank for those characters.
I tried multiple options (using CharacterSet etc) mentioned in links below but couldn't find a solution.
Also checked this on Java 1.5 and 1.6 but still the issue persists.
Upvotes: 0
Views: 2934
Reputation: 31
I faced same issue in past. Here are some pointers:
1) Setting the nls_lang parameter programmatically, if it is not set up already.
Locale.setDefault(Locale.<your locale here>);
2) Try setting up encoding to UTF8 in environment variable as (If you outputting result in a file )
java -Dfile.encoding=UTF-8 … com.x.Main
3) As you mentioned "select" from JDBC please check eclipse settings.
Window--> Workspace --> Text File encoding --> Other --> UTF8
4) SQL-Developer is smart enough to show various special chars however tools like notepad/textpad/notepad++ needs proper settings before they can start showing special chars.
5) Check if you need the orai18.jar in classpath. This jar is needed for support related to CLOB and oracle types etc.
Upvotes: 1