• Post Reply Bookmark Topic Watch Topic
  • New Topic

Uploading and downloading data from excel sheet  RSS feed

 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • 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
  • 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: 42972
73
  • Mark post as helpful
  • send pies
  • 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
  • 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: 42972
73
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!