Type 4 JDBC driver for MS ACCESS(.mdb) database?

15,003

Solution 1

MS Access databases on MS Windows are driven by the Microsoft Jet Engine. Different from client server database management systems like MS SQL Server or MySQL the connection to a MS Access database runs in embedded mode via OLE and some DLLs.

As far as I know there is no Jet Engine implementation for operating systems other than MS Windows. So if you want to connect to a MDB file on Mac OS a simple JDBC driver is not enough. There has to be some kind of emulation layer to emulate the Jet Engine DLLs. According to the HXTT website this is exactly the way the HXTT JDBC driver works.

From the HXTT website:

It contains a fast database engine written in Java, which supports embedded and server modes.

If the usage of the MS Access database format is an absolute requirement, then these kind of emulation might be the best way for you. But you have to testify if the compatibility level is high enough. (Maybe there is no way to access VBA macros contained in the MDB file.)

It seems there is no open source project doing the same kind of emulation like HXTT.

There are several alternatives. If you want an embedded database system then you can use for example

  • SQLite (this JDBC driver supports Mac Os) (one database file, requires some native libraries),
  • H2 (only a few database files, pure Java) or
  • Apache Derby (many database files, pure Java).

Or you can use a client server database management system, install the server on a host and connect to that host from your Mac OS machine. For that you can use for example

Even the pure Java databases H2 and Derby have client server modes.

Solution 2

I've used jackcess to read the tables from an MDB and convert the database to sqlite3. Not ideal if you need to keep the .mdb format, but it allowed me to keep the database in a single file and made the database cross-platform.

Solution 3

I suppose UCanAccess is what you are looking for.

It is an open source Java JDBC Driver implementation which allows Java developers and jdbc client programs (e.g., DBeaver, NetBeans, SQLeo, Open Office Base, Libre Office Base, Squirrell) to read/write Microsoft Access database. Because it is a pure java implementation it run in both Windows and non-Windows Operative Systems (e.g., linux/unix). No ODBC needed.

Solution 4

StelsMDB is not as expensive as HXTT, still not open source...

http://www.csv-jdbc.com/stels_mdb_jdbc.htm

Have'n tried it, but evaluation copy is available.

Anyone else got suggestions? I'm looking for an opensource variant myself. Shouldn't be impossible to build on top of jaccess ...

Share:
15,003
Jinith
Author by

Jinith

Updated on June 24, 2022

Comments

  • Jinith
    Jinith almost 2 years

    My Java application uses a .mdb database and i want to run this application on MAC OS for that am definitely gonna nead a TYPE 4 JDBC driver i have google and came across two - HXTT & StelsMDB but both are out of my reach

    So if any body has some alternative or suggestions please reply.

    Thanks in advance