• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Export text in Oracle Clob to MS Word in java

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic