1. Using an SQL editor, check the content of the database. Make sure the string is properly inserted. (I wonder why you are using unicode strings like this...)
2. What does the String contains after fetching data from the DB ? Either debug it, or output the String in a file and open the file with an editor which supports unicode.
3. How did you set the web page encoding ?
1. Japanese string is properly inserted in the DB. I had read in Oracle Technical Network that non-ascii strings could be inserted in this way. When I query this string using "select unistr('\0041\0063\0063\0065\0073\0073\0020\004d\0061\006e\0061\0067\0065\006d\0065\006e1\006e\0061\0067\0065\006d\0065\006e\0074\0020\0054\006f\006f\006c\0020\304b\3089\306e') from dual;" then it is showing me the correct japanese message.
2. String contains all ???. I saw printing it on the browser as well as in the log.
3. Web page encoding is set in the Websphere server that we use and is set to 'ISO8859-1'.
I have tried converting the mydatabasestring to correct japanese string in below ways but still only question marks (???) appear.
out.println("1."+new String(mydatabasestring.getBytes("UTF-8"),"ISO-2022-JP"));
out.println("2."+new String(mydatabasestring.getBytes("ISO-2022-JP"),"UTF-8"));
out.println("3."+new String(mydatabasestring.getBytes("ISO-2022-JP"),"ISO-2022-JP"));
out.println("4."+new String(mydatabasestring.getBytes("Cp1252"),"Cp1252"));
out.println("5."+new String(mydatabasestring.getBytes("ISO-2022-JP"),"Cp1252"));
out.println("6."+new String(mydatabasestring.getBytes("Cp1252"),"ISO-2022-JP"));
out.println("7."+new String(mydatabasestring.getBytes("UTF-8"),"Cp1252"));
out.println("8."+new String(mydatabasestring.getBytes("Cp1252"),"UTF-8"));
Is there anything that I am missing here ???