my dog learned polymorphism
The moose likes Java in General and the fly likes Reading Excel sheet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Reading Excel sheet" Watch "Reading Excel sheet" New topic

Reading Excel sheet

Balaji Natarajan

Joined: Dec 05, 2002
Posts: 28
I searched for the above mentioned subject in this forum and I came to know about POI-HSSF for handling excel sheets from java. But I am not able to find the exact location to download the necessary jars. Could anyone tell me the exact link for that.
Thanks in advance
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I believe the answer you desire lies in what we experts call "search engines."

Balaji Natarajan

Joined: Dec 05, 2002
Posts: 28
Thanks Nathaniel, Here is the exact link for the files.
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
In addition, if the Excel is in CSV format, Java can read it directly, and process the data accordingly.

SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Jeremy Wilson
Ranch Hand

Joined: Feb 18, 2003
Posts: 166
The easiest way I have found to read from an excel spreadsheet is with JDBC/ODBC bridge. The sun driver is included with Java 1.4.1 SDK. You use the JDBC api as with any other standard RDBMS. For instance if you wanted to read sheet 1's columns you would use a select statement like
"select * from [sheet1name$]"
The only issue is the [$] must be in that format for the table name. You can use the first row as the column names and access certain columns in the select statement.
You then process the returned ResultSet as normal.

Jeremy Wilson
wood burning stoves
subject: Reading Excel sheet
It's not a secret anymore!