Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to read from an excel sheet in linux?

 
vishwanath nadimpally
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I am able to read data from an Excel sheet using JDBC in a windows environment. But I have no idea how to create an ODBC data source in linux and use it for reading from an Excel sheet. Can someone help me on this please.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure that ODBC exists for Linux. have you looked at libraries like POI and jExcelApi which let you XLS files directly?
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The are ODBC drivers for Linux; however, I don't happen to know of any free ones (there might be some).

ODBC is not built into the operating system in Linux, the way it is in Windows. If you insist on using the JDBC-ODBC bridge, you will need to find a Linux ODBC driver that can read an Excel file.

There's probably a good chance that someone has either written a JDBC type 4 driver for excel, or that there's a good non-JDBC Java way to read Excel files.
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by stu derby:
The are ODBC drivers for Linux; however, I don't happen to know of any free ones (there might be some).

ODBC is not built into the operating system in Linux, the way it is in Windows. If you insist on using the JDBC-ODBC bridge, you will need to find a Linux ODBC driver that can read an Excel file.

The non-JDBC packages mentioned in the other response are probably a better choice though; Excel really isn't a database and accessing it through JDBC is a semi-crufty hack, IMHO.
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by stu derby:

There's probably a good chance that someone has either written a JDBC type 4 driver for excel files



Yes, there is one at http://sourceforge.net/projects/xlsql/


Shailesh
 
vishwanath nadimpally
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by stu derby:

The non-JDBC packages mentioned in the other response are probably a better choice though; Excel really isn't a database and accessing it through JDBC is a semi-crufty hack, IMHO.


I took your advice and wrote a control file and put it in oracle using sqlldr.

Thanks for all suggestions
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic