| |||||||||||
Reading data from Excel in Java Posted by enquirer (enquirer), 21 June 2003 Problem - I have a series of Excel spreadsheets (circa 50) and I want to grab certain cell values from them and save those values into an SQL database. I wish to use Java because I already know it, and the rest of the suite (including Servlets to pull data back out of the database) is already written in Java. One key feature is the need to automate the data extraction - the operation is going to be done daily and cut-and-paste or even type-a-list-of-all-spreadsheet-names solutions are not going to be acceptable. It needs to be click and extract.Posted by admin (Graham Ellis), 21 June 2003 Microsoft provide an ODBC driver for Excel; you can then use the Sun JDBC-ODBC driver to talk to it. See http://www.javaworld.com/javaworld/javaqa/2001-06/04-qa-0629-excel.html for a more detailed technical article. Note that column names are derived from the first row of the spreadsheet in the ODBC driver, and this solution may not be good if you're data isn't styled like a classic table. There's code sample(s) that you can download at http://www.codebytes.com/content/exceljavasample.htm and an update to the original article at http://www.javaworld.com/javaworld/javaqa/2001-08/02-qa-0824-excel2.html.If you're running on a Microsoft platform, you could also use the COM object directly http://www.nevaobject.com/_docs/_java2com/java2com.htm through Java2COM from Neva Object technology. 30 day evaluation download available, but no license price given ("email for license information") which worries me slightly. The ExtenXLS Java|XLS Toolkit v2.1 is a paid, supported product; it's price tag is probably a bit high if you're just looking to read data ... but anyway, the URL is http://www.extentech.com/estore/product_detail.jsp?product_cat_id=1&product_group_id=1 and they're talking over $1000. An even more expensive solution is the Formula One e.Spreadsheet Engine - see http://www.reportingengines.com/products/espreadengine/overview.jsp; price over $4000 per server. Posted by Custard (Custard), 11 October 2003 Probably a bit late now, but theres POI HSSF at the Jakarta Project...http://jakarta.apache.org/poi/hssf/index.html HTH Posted by admin (Graham Ellis), 11 October 2003 Not at all late in the day - these pages build up to form a resource that gets indexed by Google, Alta Vista and the like and visitors arrive from all over the world .... Just try typing in"Reading data from Excel in Java" into the Google search box, and you'll see what I mean This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |