• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 43081
77
  • 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: 43081
77
  • 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: 43081
77
  • 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.
 
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic