File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Export text in Oracle Clob  to MS Word in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Export text in Oracle Clob  to MS Word in java" Watch "Export text in Oracle Clob  to MS Word in java" New topic
Author

Export text in Oracle Clob to MS Word in java

Chris Johnson
Greenhorn

Joined: Dec 07, 2004
Posts: 4
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

Joined: Feb 15, 2005
Posts: 4864
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).


Merrill
Consultant, Sima Solutions
Chris Johnson
Greenhorn

Joined: Dec 07, 2004
Posts: 4
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.
 
GeeCON Prague 2014
 
subject: Export text in Oracle Clob to MS Word in java