Upload

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • radhikams
    New Member
    • Jan 2008
    • 49

    #1

    Upload

    Hi
    Plz help me out in saving an uploaded file into oracle using struts and jsps....

    Thanks
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by radhikams
    Hi
    Plz help me out in saving an uploaded file into oracle using struts and jsps....

    Thanks
    What have you done so far?

    Comment

    • radhikams
      New Member
      • Jan 2008
      • 49

      #3
      hi
      actually uploading a file n storing it in database is part of my application.
      The things i have done are i have written my jsp page and the setter and getter methods of the file...
      now im stuck with database query of inserting the file into the database.i have no clue abt how to proceed with it.
      can u plz help me out......

      Thanks

      Comment

      • BigDaddyLH
        Recognized Expert Top Contributor
        • Dec 2007
        • 1216

        #4
        Originally posted by radhikams
        hi
        actually uploading a file n storing it in database is part of my application.
        The things i have done are i have written my jsp page and the setter and getter methods of the file...
        now im stuck with database query of inserting the file into the database.i have no clue abt how to proceed with it.
        can u plz help me out......

        Thanks
        Clearly this problem breaks down into at least 2 steps:
        1. Uploading the file
        2. Storing the file

        Some web application frameworks have built in support to make uploading a file easy. Otherwise, you might consider using something like Apache Commons FileUpload: http://commons.apache.org/fileupload/

        Are for storing the file in a database, there are two common solutions to this. One is to just store the file in the file system of the server and store the path of this file (as a string) in the appropriate column in the appropriate database table.

        The other approach is to store the contents of the file as data in a column. Such a column with have type BLOB (or CLOB if storing text). If your are using JDBC directly, inserting the data into the column is easy: use a PreparedStateme nt and setBinaryStream or setCharacterStr eam. For more information: http://java.sun.com/docs/books/tutorial/jdbc/index.html

        Comment

        • radhikams
          New Member
          • Jan 2008
          • 49

          #5
          Thank u so much that had helped me a lot
          If any queries i will get back u



          Originally posted by BigDaddyLH
          Clearly this problem breaks down into at least 2 steps:
          1. Uploading the file
          2. Storing the file

          Some web application frameworks have built in support to make uploading a file easy. Otherwise, you might consider using something like Apache Commons FileUpload: http://commons.apache.org/fileupload/

          Are for storing the file in a database, there are two common solutions to this. One is to just store the file in the file system of the server and store the path of this file (as a string) in the appropriate column in the appropriate database table.

          The other approach is to store the contents of the file as data in a column. Such a column with have type BLOB (or CLOB if storing text). If your are using JDBC directly, inserting the data into the column is easy: use a PreparedStateme nt and setBinaryStream or setCharacterStr eam. For more information: http://java.sun.com/docs/books/tutorial/jdbc/index.html

          Comment

          Working...