I have multiple excel file, using apache poi library I can read each excel file and set the data to object.
for example, employee.xls:
emp.id firstname dob
111111 fName 19/10/2011
222222 tName 11/12/2010
and the object as below:
class Employee {
private String empId;
private String firstname;
private Date dob;
public String getEmpId() {
return empId;
}
public void setEmpId(String empId) {
this.empId = empId;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public Date getDob() {
return dob;
}
public void setDob(Date dob) {
this.dob = dob;
}
}
For pushing a data I need to read from excel file and set to the Employee object. In case I have more than 20 different xls files then I need to write code for each excel file to read and then set the data to respective object. Is there any other effective way to achieve this?
Thanks in advance!