This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ODBC Driver Manager exception

 
Dilanka Muthukumarana
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I am facing problem which is with ms access database connection. below is my code. please help me on this.




below is the exception:

 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using Java 8, by any chance? That no longer includes the JDBC/ODBC bridge driver.
 
Dilanka Muthukumarana
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I am using java 1.6 on Windows 8.1 OS.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the full stack trace of the exception. The connection URL you're using looks somewhat different from the ones I've seen elsewhere, like in http://www.coderanch.com/how-to/java/OdbcJdbcQuestions, so you should try that format as well.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dilanka,
As stated, the database connection URL is incorrect.
Firstly, this part of the URL:
(*.mdb)
means you want to use the ODBC driver that handles "mdb" files.
However you refer to a "accdb" file since your filename in the URL is "ShoppingCart.accdb".
Also, you need to write the full path of your file, as indicated in the comment in the source code you posted that immediately precedes the declaration of local variable "url".
So the declaration of "url" should be something like...


Good Luck,
Avi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic