Poi vs jxl (one of Java Excel operations)

Source: Internet
Author: User

Java is used to operate Excel tables. Only poi is known before. Poi is a sub-project of Apache. It mainly provides a set of Java APIs for Operating Windows documents.

There is also a jxl (Java Excel), which is also an open-source project. It feels similar to poi, because the functions used are very simple and there is no big gap between them. Some of their differences are found on the internet, and they are offering their own literacy.

Since the MS discloses the Office encoding format, many open-source organizations have provided plug-in packages that support read and write operations on Excel. In the Java World, Apache should be the leader in the Open Source world. The poi project in his Jakarta project provides the perfect support for office (however, it seems that his support for word projects has been stopped recently and people are publicly available on the website ^, if you are familiar with the encoding format of Word files, you can send an email !). Jxl and Java Excel are open source projects. Java developers can read the content of Excel files, create new Excel files, and update existing Excel files. Using this API, non-Windows operating systems can also use Java-only applications to process Excel Data Tables. Because it is written in Java, we can use JSP and Servlet in web applications to call APIs to access Excel Data Tables.

Jakarta's poi project and Java Excel API are both in the Open Source world, but they also have advantages and disadvantages. Poi has some minor bugs in some details and does not support writing images (POI can actually write images, but it's not as convenient as jxl, it's troublesome), and other aspects are quite good; while jxl provides support for images (but only supports images in PNG format ), the problem is that it does not support formulas very well, but it still supports reading simple formulas. Therefore, it is up to your application to decide what third-party plug-ins to use in your project. If your software is related to finance, it is recommended to use the poi project. If you do not use the formula and you may need to export images, select jxl.
.

The difference between the two lies in the memory consumption of JVM virtual machines.
3000 data records per 60 columns. The jvm vm memory size is 64 MB.
Use poi: A memory overflow is reported when about 2800 logs are run.
Use jxl: 3000 entries all out, and there is still 1 MB of memory space.
It can be imagined that there is a huge gap in memory consumption.
It may be because jxl is doing a good job in Resource Recycling.
I have not studied the efficiency of the two. I think this is also based on the large data volume. If the data volume is small, it is not difficult to find out. however, with large data volumes, poi consumes much more JVM memory than jxl. however, compared with the provided functions, jxl is relatively weak. therefore, if you want to implement more complex functions, you can consider using poi, but if you only want to generate a large amount of data, you can consider using jxl, or CSV is also a good choice, however, CSV is not really an Excel file.

Basic Excel operations
Jxl: Basic Excel APIs
Poi: it is also a basic API. It does not have a high efficiency of jxl when reading 2 MB files. The advantage is that it can maintain the original Macros in Excel (but cannot be used to write new macros ).

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.