File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and Relational Databases and the fly likes JDBC for reading MDB file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC for reading MDB file" Watch "JDBC for reading MDB file" New topic
Author

JDBC for reading MDB file

John Spear
Greenhorn

Joined: Jan 17, 2014
Posts: 3
Hi All,

I am trying to read an MDB file using JDBC api. However dint find anything yet. Could anyone provide any links or suggestions or guide somehow?

HOWTOREAD_INTERPRET:JDBC api for reading via an MDB file

Any kind of help is appreciated.

Regards,
John
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32305
    
213

John,
Welcome to CodeRanch!

Take a look at this thread. Does it answer your question? Or give you a more specific question to ask here?


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
John Spear
Greenhorn

Joined: Jan 17, 2014
Posts: 3
Thanks Jeanne,

The link you provided is for Linux version not supporting the odbc.

However the environment i have been working on is Java 7 on Windows 7 64 bit ,and the error i am getting while using the same is pasted below-

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

code snippet for a reference-
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String database = "jdbcdbcRIVER={Microsoft Access Driver (*.mdb)};DBQ=/home/sample.mdb";

Appreciate your advise again .
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
According to http://www.coderanch.com/how-to/java/OdbcJdbcQuestions, you need to use a slightly different DB URL for 64-bit Java.
John Spear
Greenhorn

Joined: Jan 17, 2014
Posts: 3
Thanks Ulf for the reply!


The code is again giving the same error as pasted below-
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Appreciate your response.

Regards,
John
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JDBC for reading MDB file
 
It's not a secret anymore!