This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Export text in Oracle Clob to MS Word in java

 
Chris Johnson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I need your help.

I want to retrieve data that is stored in Oracle Clob using java and exporting it to Microsoft Words. I got it to work but the problem is when I have carriage return <CR> in Clob MS Word couldn't recognized it as carriage return, so it's displaying the text continuously without a carriage return. Can some one show me how can I convert CR to something that MS Word can understand ?

I am using oracle.jdbc.OracleResultSet instead of java.sql.ResultSet

Thanks for your help
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the text file in the CLOB was created on a unix system, this might explain the problem.

Unix and DOS store text files differently. DOS places both a line feed and a carriage return character at the end of each line, while Unix places only a line feed character.

You might search for line feed characters (ascii 10) and replace them with a line feed and a Carriage return (ascii 13).
 
Chris Johnson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh sorry, I didn't mean text file. The user just type it in a form that I created in JSP and it save to Clob. The problem is when they export to MS Word it couldn't recognized the carriage return.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic