Results 1 to 11 of 11

Thread: please help me

  1. #1
    syedabu is offline Member
    Join Date
    Feb 2010
    Posts
    23
    Rep Power
    0

    Default please help me

    hi..,i am doing my project..i need to upload a text file.i manually split by each field i separate a substring like '|'..how can i upload using struts....
    please help me.....

  2. #2
    Aseem is offline Senior Member
    Join Date
    Mar 2009
    Location
    USA
    Posts
    127
    Rep Power
    0

    Default

    Struts File Upload and Save

    have a look at above link.

  3. #3
    syedabu is offline Member
    Join Date
    Feb 2010
    Posts
    23
    Rep Power
    0

    Default

    thanks man......
    but my doubt is..i create a database.i got a table with 5 fields..in this table i store some record in the form text file......
    sno name mark1 mark 2 mark3
    1 syed 77 77 77



    the text file look like this format..

    i store it to the text file is like use of substring '/"
    1/syed/77/77/77/

  4. #4
    Aseem is offline Senior Member
    Join Date
    Mar 2009
    Location
    USA
    Posts
    127
    Rep Power
    0

    Default

    so you are not uploading file right? do u mean that you are only transferring the content of text file to database?

  5. #5
    Aseem is offline Senior Member
    Join Date
    Mar 2009
    Location
    USA
    Posts
    127
    Rep Power
    0

  6. #6
    syedabu is offline Member
    Join Date
    Feb 2010
    Posts
    23
    Rep Power
    0

    Default please

    till now i didnt upload the file..please help me

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,006
    Rep Power
    20

    Default

    Do you mean you want to know how to split the string (like the example you mentioned) and insert the values into the database?

    What code have you done so far, and where (exactly) are you hitting a problem?

  8. #8
    syedabu is offline Member
    Join Date
    Feb 2010
    Posts
    23
    Rep Power
    0

    Default its my problem

    i get the file through jsp..
    the file can be given through the input
    of bulk insert in sql query like this..
    in this
    i give
    ps.set......?
    how can i get and set file in the prepared statement...
    i am using sql query analyzer to bulk insert.but in struts the file cannot be uploaded?

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,006
    Rep Power
    20

    Default

    So you have two problems?
    One, you don't know how to do the setter for the prepared statement, and the other you don't know how to upload the file?

    What's the code for your statement at the moment then?

  10. #10
    syedabu is offline Member
    Join Date
    Feb 2010
    Posts
    23
    Rep Power
    0

    Exclamation please

    i solved one prob...'
    i need the code of file upload into sql server...
    please send the code

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,006
    Rep Power
    20

    Default

    You still haven't actually given us the SQL you're attempting to use...but anyway.
    Either you'll have to read each line of your file and do an INSERT, executing as a batch, or you'll have to save the file and do a BULK INSERT or use DTS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •