DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Join Date
    Jan 2005
    Location
    Bangalore
    Posts
    19

    Unhappy Storing of Word Docs in the database

    Hi,

    Can anyone tell me how I could save the doc that I have retrieved (using the File tag).
    I’m able to read the file; I would like to know how I could save the same in the database (SQL) i.e. the file streams that I could use in the JSP tag.

    the following code only helps me to view the contents in the server as an output...

    String f1=request.getParameter("file");
    System.out.println("f1----------------"+f1);
    // Open the file that is the first
    // command line parameter
    FileInputStream fstream = new FileInputStream(f1);
    // Convert our input stream to a
    // DataInputStream
    DataInputStream in = new DataInputStream(fstream);
    // Continue to read lines while
    // there are still some left to read


    while (in.available() !=0)
    {
    // Print file line to screen
    System.out.println (in.readLine());
    }

    in.close();

    But i need to save the same in another file and then save it in the local SQL server machine.

    Can anyone please help me?


    Thanks in advance.
    Last edited by Litha; 01-24-2005 at 08:46 AM.
    Cheers,

    Lee

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links