Parsing excel data in Java before saving it to database [closed]

I’m working on some project where I have to make a database to store data which is currently kept in Excel files, so I have to do some changes before writing the data into the database.

I’m going to read those files using Java and write them from Java into the database. Should I use Hibernate for that job? Or how else can I connect to those Excel sheets, read data in Java, and write to the database?

3

It’s possible to query Excel sheets using SQL with ODBC. The sheets are treated like tables. You can even join the sheets like you would database tables! I’d recommend you try this option first. Google java + ODBC + excel for details.

There is apache’s POI libary. http://poi.apache.org/
I’m not sure if this works on the old “binary” format or just the new XML format of newer versions of excel. But I remember someone I worked with used some sort of apache libarry to work with binary-format excel sheets a few years back.

In .NET you can use the excel interop library to get the data out of the excel sheet (as well as do anything else that you could possibly do in excel).

Once you’ve extracted the data from excel, you can load it into the database how you normally would.

1

LibreOffice and OpenOffice could scale you to the moon. Headless Linux-Mac-Win.
You can get the contents of spreadsheet with about 200 lines of code.

Use the OpenOffice.org (or LibreOffice) APIs to open the spreadsheet files, access the data, perform the transformations, and then write the proper data into the new database.

As long as your are not trying to do fancy things like inserting and updating formulas it’s very simple and cross platform and because it’s open source you can rack as many instances as you need. It opens up xls files by converting them to oxd. In Linux you can run in headless mode and if you multi procs you can startup multi OpenOffice daemons to process multi docs at once. It’s not marketed much as the “pro” solution, many instantly frown down on it. But I spent many years working on it starting from 2003 building a platform that printed millions impressions a year and 90% of the code is still running.

We started the implemention with 1.0 and as of last year they are using 3.x version. We didn’t have to upgrade any code to adjust for the upgrade. You don’t need any other XML API that’s version-dependent you won’t need to worry about comparability Open Office 3.x will open 97-2007 xls. I recommend this because I was a Platfrom R&D analyst and Java dev. for 8 years and I spent better part of three years researching this solution agents others.

3

If I were you, I wouldn’t use dedicated code for that.

Prefer a tool like ETL (Talend, kettle, by example).

It will be more easy to parse your file and you will have lot of problems (compatibility, maintainability, etc.) already solved.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật