aspose file tools*
The moose likes JDBC and the fly likes JDBC + MS Access without ODBC data source Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC + MS Access without ODBC data source" Watch "JDBC + MS Access without ODBC data source" New topic
Author

JDBC + MS Access without ODBC data source

Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

Is there a standard method of connecting a Java application to an MS Access database that does not involve creating an ODBC data source? Basically, a driver that allows you specify the file path as the connection string and run queries against it directly.


My Blog: Down Home Country Coding with Scott Selikoff
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18136
    
    8

You'd use the ordinary JDBC-ODBC bridge driver. And your google keywords are "java dsn-less connection".
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

Thanks, I was under the mistaken impression that the JDBC-ODBC bridge driver only worked via DSN. I did try some DSN-less samples but I'm getting the message:

"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18136
    
    8

All I can say is, it worked when I tried it 10 years ago. Since then I have been lucky enough to not have to use Access with Java.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

After a lot of searching, I discovered a solution to this issue. Namely, I need to run with a 32bit JVM, as it does not appear to work in 64bit Java.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

There is a solution for 64-bit Java although it requires some work:

1) Download Microsoft Access Database Engine 2010 Redistributable, AccessDatabaseEngine_x64.exe, and install it

2) If you are running a 32-bit version of Office, you will likely get the following error when you try to install it: "You cannot install the 64-bit version of Office 2010 because you have 32-bit Office products installed.". At this point, you must decide whether or not to uninstall the Office. Newer versions of Office, such as 2010, contain both both 32-bit and 64-bit versions on the DVD. In this case, you would first uninstall the 32-bit version of Office. Restart. Then ignore the auto-run on the DVD, and open the setup executable in the x64 directory. If you do not have access to a 64-bit version of Office, then you will unable to run the 32-bit version alongside the 64-bit Engine.

3) The connection string must be updated as follows:

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18136
    
    8

64-bit processors... an issue I didn't have to deal with back in the Dark Ages. Thanks for posting the info, Scott!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
That calls for adding to http://www.coderanch.com/how-to/java/OdbcJdbcQuestions :-)


Ping & DNS - updated with new look and Ping home screen widget
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

I'm writing up a blog article about it now actually: Connecting to MS Access File via JDBC in 64-bit Java
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC + MS Access without ODBC data source
 
Similar Threads
type four driver(thin driver) for ms-access
Type 4 JDBC Driver for MS_Access
" jdbc : odbc : " + something. what is this something?
JDBC:ODBC without ODBC data source?
connection of JDBC with oracle 9i database