如何在不使用外部jar的情况下使用Java读取Excel文件 [英] How to read excel file with Java without external jars
问题描述
我正在尝试读取excel文件并将所有数据传递给DB.我找到了一些代码示例,但所有示例都需要外部jar.如何仅使用标准库读取excel文件?
I'm trying to read excel file and pass all the data to DB. I found a few code examples but all of them required external jars. How can I read excel files using only the standard library?
推荐答案
IF you don't want to use a library then you will have to download the Excel file format specs from MS and write an Excel parser yourself (which is extremely complicated and takes > 10 years for one developer). For the OpenXML format spec see here and here.
因此,我真的建议为此使用一个库...
Thus I really recommend using a library for that...
尝试 Apache POI -用于处理MS Office文档的免费Java库.
Try Apache POI - a free Java library for dealing with MS Office documents..
这篇关于如何在不使用外部jar的情况下使用Java读取Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!