Can I store/retrieve a Word Document in a Database field?

What conditions should me met to store/retrieve a Word Document in an Oracle database field?
May be many things will be necessary to consider but, could you give me some guides? Do yo know about some web site place that talks about it?
Thank you in advance!!!

Look at
Re: How to store a "word document" on Data Base?
hope helps

Similar Messages

  • How do i retrieve the word document format

    I write a java program which writes a word document in to a BLOB in oracle database. and i retrieve the word document from the database and flush the output to a word document in local path. i do get the output and the word document is saved to my local path, but when i try to open the document it opens ina junk format which cannot be read.. how to preserve the format of the document??
    here is the sample code..
    I open a connection.......
    File fileIn     =     new File("C://input.doc");
    FileInputStream     finput     =     new FileInputStream(fileIn);
    BufferedReader br     =     new BufferedReader(new InputStreamReader(finput,"Cp1252"));
    String lStrDoc_name     =     "1011";
              Conn.setAutoCommit(false);
              String lStrQuery     =     "insert into TESTPDF (" +"DOC_NAME,"+"DOCUMENT,"+"DOC_URL) "+" values(?,?,?)";
              pStmt = Conn.prepareStatement(lStrQuery);
              pStmt.setString(1,lStrDoc_name);
              pStmt.setBlob(2,newblob);
              pStmt.setString(3,"C://testing.doc");
              pStmt.executeUpdate();
              pStmt.close();
              Conn.commit();
              Statement     st     =     Conn.createStatement();
              ResultSet rs= st.executeQuery("select DOCUMENT from TESTPDF where DOC_NAME = " + lStrDoc_name + " for update");
              if(rs.next())
                   oracle.sql.BLOB blob=((oracle.jdbc.driver.OracleResultSet)rs).getBLOB(1);
                   System.out.println("BLOB-------->"+blob);
                   OutputStream outbb=blob.getBinaryOutputStream();
                   for(int i = 0; i < fileIn.length(); i++) {
                        outbb.write(br.read());
                   outbb.flush();
              rs.close();
              Conn.commit();
    Later i read the blob and store my output...
    the code is as follows....
    String lStrQuery     =     null;
              String lStrDoc_Name     =     "1011";
              String lStrDoc_Url     =     null;
              Blob newBlob     =     null;
              InputStream     fInput     =     null;
              BufferedReader br     =     null;
              FileOutputStream     fOutput     =     null;
              lStrQuery     =     "Select * from TESTPDF where DOC_NAME=" +lStrDoc_Name;
              try {
                   pStmt     =     Conn.prepareStatement(lStrQuery);
              } catch (SQLException e2) {
                   // TODO Auto-generated catch block
                   e2.printStackTrace();
              try {
                   rs = pStmt.executeQuery();
                   if(rs.next())
                        lStrDoc_Name     =     rs.getString(1);
                        newBlob               =     rs.getBlob(2);
                        lStrDoc_Url          =     rs.getString(3);
                        if(newBlob != null)
                             fInput = newBlob.getBinaryStream();
              } catch (SQLException e3) {
                   // TODO Auto-generated catch block
                   e3.printStackTrace();
              String lStrOutputFileName     =     "C://"+lStrDoc_Name+"testing.doc";
              try {
                   fOutput     =     new FileOutputStream(lStrOutputFileName);
              } catch (FileNotFoundException e5) {
                   // TODO Auto-generated catch block
                   e5.printStackTrace();
                   byte b;
                   try {
                        while ((fInput.read()) > -1) {
                             b = (byte) fInput.read();
                             fOutput.write(b);
                   } catch (IOException e4) {
                        // TODO Auto-generated catch block
                        e4.printStackTrace();
    The word document is stored in my local path.. but iwas not able to read the document. it opens in some ascii format..
    Your help is appreciated..

    BufferedReader br = new BufferedReader(new InputStreamReader(finput,"Cp1252"));Preserving the format would include not mangling it by using a Reader to read it. If you want to preserve it byte for byte then only use InputStream and OutputStream.

  • Storing PDF and Word document in oracle database

    any idea, how to store PDF and word document using oracle database.
    thanks

    The common approach is store as BLOB in database, use DBMS_LOB package to handle the loading and reading, sample script source asktom
    Also check this thread in Asktom
    SQL> create table demo
      2  ( id        INT PRIMARY KEY,
      3    theBlob   blob,
      4    dummy_col VARCHAR2(1)
      5  )
      6  /
    Table created.
    SQL> -- --------------------------------------------------------------
    SQL> -- Load a PDF file into a BLOB field and compress the BLOB.
    SQL> -- --------------------------------------------------------------
    SQL> declare
      2      l_blob    blob;
      3      l_bfile   bfile;
      4 
      5  begin
      6      insert into demo (id, theBLOB) values ( 1, empty_blob() )
      7      returning theBlob into l_blob;
      8 
      9      l_bfile := bfilename( 'BLOB_DIR', 'Test.PDF' );
    10      dbms_lob.fileopen( l_bfile );
    11 
    12      dbms_lob.loadfromfile( l_blob,
    13                             l_bfile,
    14                             dbms_lob.getlength( l_bfile ) );
    15 
    16      UPDATE demo
    17      SET    theBlob = utl_compress.lz_compress(l_blob, 6)
    18      WHERE  id = 1;
    19  -- If you don't want compress the LOB just update directly
    20      dbms_lob.fileclose( l_bfile );
    21      COMMIT;
    22  end;
    23  /
    PL/SQL procedure successfully completed

  • Retrieve a word document (Blob)

    Hi
    I have a table with
    BLOBS(id number, documnets);
    I had inserted the word document
    I want to retrieve the word document and display it as a link....
    On click of the link ,..the document should be opened or should be asked for downloading
    can some tell me how to get it in JSP
    Thanks in Advance
    Sreedhar

    you should use a ByteInputStream or something, and write it to a file.. Then, using jsp, create a hyperlink to this file..
    make sure the file is deleten afterwards (or write it in a temp map so you can delete this map once a day)..
    say you have a table and have requested the right row with an Query.. this gives you a resultset (named rs)
    FileOutputStream ostream = new FileOutputStream(rs.getString("FileName"));
    ObjectOutputStream output = new ObjectOutputStream(ostream);
    output.writeObject(new ByteArrayInputStream(rs.getBytes("WordFile"));
    output.close();
    ostream.close();
    I guess something like this should do the trick..

  • Is there a free app I can download that is a (Word) Document on my Mac?

    Is there a free app I can download that is a (Word) Document on my Mac?

    As far as I know, any free word processing apps would be no where near as good as opposed to just purchasing iWork (Apple's version of Word) or Microsoft Office for Mac. It's definitely worth the price to buy one of these if your planning on using it a lot.
    iWork
    http://www.apple.com/iwork/pages/
    Microsoft Office for Mac
    http://store.apple.com/us/browse/campaigns/office

  • How can 2 user edit 1 word document at the same time

    hi,
    in office 2013 professional plus, can 2 user edit 1 word document at the same time?

    Hi,
    As far as I know, multiple users can not edit Word file in the same time directly. Could you give me your demand?
    Please check the two follows workarounds if they are helpful:
    http://blogs.msdn.com/b/johnmullinax/archive/2010/04/19/co-authoring-how-two-people-can-edit-one-word-2010-doc-at-the-same-time.aspx?Redirected=true
    http://www.ehow.com/how_7229904_allow-word-document-same-time.html
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Regards,
    George Zhao
    TechNet Community Support
    Hi
    thank you; its worked.
    I'm so excited about this; thank you again.

  • How can I change a Microsoft Word document file into a picture file?

    How can I change a Microsoft Word document file into a picture or jpeg file? I am wanting to make the image I created my background on my macbook pro.

    After I had the document image the way I wanted it, I saved it as a web page and went from there. Below are the steps starting after I did the "save as" option in Word:
    1) Select "Save As Web Page". I changed the location from documents to pictures when the window came up to save it as a web page.
    2) Go to "Finder" on you main screen, or if it's on your main toolbar at the bottom.
    3) Click on the "Pictures" tab and find the file you just re-saved as a web page. (I included "web page" or something similar in the new title so I could easily find the correct file I was looking for)
    4) Open the correct file and then "right click" on the actual image. (Use 2 fingers to do so on a Mac)
    5) Select 'Use Image As Desktop Picture", and voilà! The personally created image, or whatever it is that you wanted, is now your background.
    **One problem I encountered while doing this is that the image would show up like it was right-aligned in relation to the whole screen. The only way I could figure how to fix this was to go back to the very original document in Word, (the one before it was saved as a web page), and move everything over to the left.
    I hope this helps someone else who was as frustrated as I was with something that I thought would have been very simple to do! If you have any tips or suggestions of your own, please feel free to share. : )

  • Did I miss something in the fine print? I installed Lion and and come to find out, I can no longer open any Word documents or Excel spreadsheets as they are no longer supported (being PowerPC apps).  Seriously?!?!?!?!!   What are my alternatives?

    Did I miss something in the fine print? I installed Lion and and come to find out, I can no longer open any Word documents or Excel spreadsheets as they are no longer supported (apparently because they are PowerPC apps).  Seriously?!?!?!?!!   What are my alternatives?

    Hi Mary and Matthew
    You might find it helpful to "try before you buy" - there is a 30 day free trial offer for Office for Mac 2011, accessible from M's .com website.
    You may be able to use this period to open and resave your old documents in a format that enables you to switch instead to using Apple's iWorks apps moving forward.
    I initially intended to do something similar, but ended up buying Office as it provided an easier way (for me, at least) to continue working with years worth of old emails, letters, spreadsheets and other documents (from my PC days) without risking damage to their integrity, formatting, etc.

  • How to fix EXC_BAD_ACCESS error? I just upgraded to 10.7.5 and now I can't open any MS Word documents

    How to fix EXC_BAD_ACCESS error? I just upgraded to 10.7.5 and now I can't open any MS Word documents.
    I get this error message every time:
    Microsoft Error Reporting log version: 2.0
    Error Signature:
    Exception: EXC_BAD_ACCESS
    Date/Time: 2013-05-28 02:28:42 +0000
    Application Name: Microsoft Word
    Application Bundle ID: com.microsoft.Word
    Application Signature: MSWD
    Application Version: 14.3.4.130416
    Crashed Module Name: Microsoft Word
    Crashed Module Version: 14.3.4.130416
    Crashed Module Offset: 0x00938638
    Blame Module Name: Microsoft Word
    Blame Module Version: 14.3.4.130416
    Blame Module Offset: 0x00938638
    Application LCID: 1033
    Extra app info: Reg=en Loc=0x0409
    Crashed thread: 0
    I tried to remove the plist files, but it hasn't worked! Please help!

    What version of Microsoft Office for Mac do you have?
    Pete

  • Once I convert pdf to WORD, why can't I edit the WORD document?

    Once i convert PDF to WORD, why can't i edit the WORD document?

    Hi sophtex,
    Kindly refer this FAQ:Can't edit converted Word or Excel file
    Please let me know for further assistance.
    Regards,
    Florence

  • Can an ipad read microsoft word documents

    Can an iPad read Microsoft Word documents?

    You only need those apps if you wish to create/edit Word documents.

  • Why can't i open a word document on my pad

    why can't i open a word document on my pad?  I used to be able to but now I can't.  Is there a setting that I can change?

    Try a Reset [Hold the Home and Sleep/Wake buttons down together for 10 seconds or so (until the Apple logo appears) and then release. When the screen goes blank power On again in the normal way.] It is absolutely/appsolutely safe!

  • OTM can not open attachment with Word Document(*.docx)

    With more and more use of Word Document(*.docx) (version 2007). OTM (Oracle Test Manager) can create an attachment with it, but can not open attachment with Word Document(*.docx). Is this a problem for anyone else? Any wok around?
    Thanks
    Katherine

    I am using OTM version 9.2 and the Word document (*.docx) attachment can be opened in this.
    For being able to open a docx file, try to attach an word document from the file option in the Requirements, Test or Issue tabs in OTM , once you upload the file, please check if location is " in Database" Else click update DB and upload the document.
    Once the attachment is attached to the Attachment section in the right pane, clicking on the attachment will open the *.docx document.
    This has worked for me.
    Hope this helps.

  • How can i open microsoft office word documents on my ipad 4 and edit it.

    How can i open microsoft office word documents on my ipad 4 and edit it. How to transfer my scaned documents on it

    There are a number of apps that are compatible with Office documents. Apple makes iOS versions of their own iWork apps (Pages, Keynote, Numbers) that are available free if you purchase a new iOS device and that can be purchased separately for older devices. There are also 3rd party combined suites that cost less than the separate Apple apps. Ones often recommended include Documents 2 Go,  Quickoffice and Office2 HD.
    If you can accept needing a network connection whenever you want to use the apps and have an Office 365 subscription, Microsoft has just released their Office Mobile app, though it has significant limitations. Or a server-based solution such as CloudOn might be an option for you.
    Regards.

  • Iphone 6 screen broken can the store retrieve pictures

    iphone 6 screen broken can the store retrieve pictures
    If I bring my phone to the apple store can they retrieve my pictures for me.

    Sorry, but if your screen is looked by a password and TouchID is not activated, you can't transfer the photos to a different computer, without using the touch screen.
    Did you try to transfer them to your computer?
    Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support

Maybe you are looking for