• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Uploading and downloading data from excel sheet

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

The problem is: "I have a web application and I have to do something so that user can upload excel sheet data to application and also user should be able to download data to excel sheet". I have to do this in java.

can anyone help me with the approach for this..

Thanks,
Shashi
SCJP 1.4
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Is the problem just the file upload and download (both easy enough to accomplish), or does the file have to be read upon upload, or to be generated when it's dowloaded?

If the latter, then either POI or jExcelAPi (both linked at AccessingFileFormats) can be used.
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf...

Problem is the data contained in the excel sheet should be uploaded to database (oracle 9 i) and on download data from same database can be downloaded in same excel format.

Thanks,
Shashi
 
Ulf Dittmer
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As regards file upload, read FileUpload.

Storing in the DB would probably involve a BLOB data type.

Downloading entails reading the BLOB from the DB, and then streaming the bytes to the client.

None of the steps is particularly hard, but the devil can be in the details. So take them one step at a time.
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so What i undersatnd is first I will have to FTP my excel sheet to server and then after reading each cell I will be saving data to database...Please correct me if I am wrong. But at same time I also want excel sheet to be temporarily saved on server... I mean once data is saved excel sheet should be deleted..
 
Ulf Dittmer
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether you want to open the Excel sheet and read its contents is up to your requirements. You can just take the whole thing and stuff in into a BLOB field in the database, or store it on the server file system.

Whether FTP is the best way to get the file to the server also depends on your circumstances, about which we know nothing.
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am successfully able to upload excel sheet to server and read it. But now I want to incorporate download functionalty. In this I would like to take a predefined excel template and write data from database to it.
Can you please help me out with this.

Regards,
Shashi
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a re-read of Ulf's first post. He's already pointed you in the direction of Jakarta POI.
 
If you're gonna buy things, buy this thing and I get a fat kickback:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic