Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Want to print new line by reading the string from Database

836548Oct 5 2012 — edited Oct 17 2012
Hi All,

I am facing a weired problem, When i write below code it is printing it in new line:
 StringBuffer sb = new StringBuffer(1024);
           sb.append("Hello, \n new line ");
           System.out.println(" The String is : "+sb.toString());
If i read the same data from Database (Database CharacterSet is ASCIITHAI ) and appending the string to StringBuffer
it is print like below one :

Hello, \n new line.

want to understand why it is not considering '\n' as newline when reading string from database.
This post has been answered by EJP on Oct 5 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 14 2012
Added on Oct 5 2012
10 comments
1,475 views