This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in connecting Excel to Java  RSS feed

 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i'm trying to read the contents of my Excel through Java and i'm getting an Exception.

The code is as below.



the exception is as below.


I'm using Java 32 bit, Eclipse 32 bit, Excel 32 bit and odbc5.jar. please let me know where am i going wrong.

Thanks
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error is pretty self-explanatory. " Data source name not found and no default driver specified".

When you call DriverManager.getDrivers() , what is returned in your list ?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message seems to be -at least partially- off-topic: no data source name is needed, as this is the DSN-less form of ODBC connection.

Apparently "{Microsoft Excel Driver (*xl, *.xls)}" is not recognized. Try "{Microsoft Excel Driver (*.xls)}" instead.
 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Dittmer this worked.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!