Two Methods for reading Excel from Java

Source: Internet
Author: User

1. Comparison of Java Excel reading methods

There are two typical methods to read and write MS Excel files in Java:

L Java-to-com method:

(1) jcom

(2) Jacob

L direct reading and writing of Excel files

(3) jexcel

(4) poi

In method 1, Java-com bridge is used to read and write Excel files. It must be supported by COM components in the background and cannot be used without windows.

Method 2 is to directly use Java API to access Excel files and read and write Excel files directly from disk files or JAVA input and output streams. In contrast, method 2 is more direct and does not depend on Windows platforms and COM components. Jexcel and poi are both open-source Java projects, and jexcel is an open-source project of SourceForge (Http://jexcelapi.sourceforge.net/Poi is an open-source Apache Project (Http://jakarta.apache.org/poi/). Jexcel is now available in the latest version 2.5.9, which was released in December 22, 2005. The latest version of poi is 3.0 alpha.

2. Introduction to poi Functions

Poi is a sub-project of the jakata project under Apache. Its goal is to process ole2 objects. Hssf is a mature package, mainly used to process MS Excel files. Hwpf package is being improved, mainly used to process MS Word files. The hslf package is mainly used to process MS PowerPoint documents. In addition to Java, the poi component also provides Ruby interfaces that can be used directly by ruby.

Some of the poi code comes from OpenOffice. for processing Excel documents, poi is currently the most mature and stable Java open source project.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.