Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading Excel sheet

 
Balaji Natarajan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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
Balaji.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the answer you desire lies in what we experts call "search engines."
http://jakarta.apache.org/poi/hssf/
 
Balaji Natarajan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nathaniel, Here is the exact link for the files.
http://mirrors.mix5.com/apache/jakarta/poi/release/bin
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition, if the Excel is in CSV format, Java can read it directly, and process the data accordingly.
Nick
 
Jeremy Wilson
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic