aspose file tools*
The moose likes JDBC and the fly likes How to read from an excel sheet in linux? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to read from an excel sheet in linux?" Watch "How to read from an excel sheet in linux?" New topic
Author

How to read from an excel sheet in linux?

vishwanath nadimpally
Ranch Hand

Joined: Jan 25, 2005
Posts: 116
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
Marshal

Joined: Mar 22, 2005
Posts: 41525
    
  53
I'm not sure that ODBC exists for Linux. have you looked at libraries like POI and jExcelApi which let you XLS files directly?


Ping & DNS - my free Android networking tools app
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
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

Joined: Dec 15, 2005
Posts: 333
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

Joined: Aug 13, 2004
Posts: 1081

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


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
vishwanath nadimpally
Ranch Hand

Joined: Jan 25, 2005
Posts: 116
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to read from an excel sheet in linux?