Updating file in java

Requirement -Programatically update an Excel spreadsheet in Java.

Solutions – Here an example of Apache POI to update a XLS workbook.

The existing excel file like below – Below is code to update the excel file import *; import org.hssf.usermodel. Sr Java Consultant-working on Java/J2EE/Oracle ADF/Webcenter Portal/ content and Hibernate for several years. Give your views and suggestion on [email protected] .

I'm an active member of the OTN JDeveloper/Webcenter forum.

What I thought was that I'll create 4 temp tables and distribute the total load in these 4 tables and simultaneously kick off 4 threads which would run simultaneously and load the data.

If threading would not be used then there is no reason for me to divide the load in 4 different tables.

You have to close the document, and then "write" the update back to the same document.

That is the reason, why you need to close the Input Stream.

updating file in java-2

And these are very specific mathematical calculations where i need math and date and simpledateformat classes etc.

With database in such situation you are much more flexible than with files. Could i create say 4 different temp tables which would contain all the records to be updated.

Could i use threads on these temp tables so that the records could get updated simultaneously and could complete fast.

Apache POI is a very good API , that can be handy in manipulating Excel documents.

This tutorial focuses on XLS documents (Office 97 – 2003). Iterator; public class update Excels I am an Oracle ACE in Oracle ADF/Webcenter.

Leave a Reply