Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ODBC Driver Manager exception  RSS feed

 
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: 42972
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: 42972
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
Boost this thread!