Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How to read from an excel sheet in linux?

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic