Check out the Quick Guide on using Apache POI‘s Excel Component API.
It sounds like you want to open a file, set some cell values, and write back to a file.
See the section “Files vs InputStreams” for how to open a file and “Creating Cells” for how to set values for cells and write to a file.
1
solved Sample Java code to append into an excel sheet