This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

How to read from an excel sheet in linux?  RSS feed

 
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.
 
Rancher
Posts: 42975
76
  • 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?
 
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.

 
Ranch Hand
Posts: 1084
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
Boost this thread!