4

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

skaffman
  • 381,978
  • 94
  • 789
  • 754
Jinith
  • 977
  • 6
  • 12
  • 27
  • May be of interest: http://sourceforge.net/projects/jackcess/files/ – Fionnuala Nov 26 '10 at 11:28
  • Jackcess is not a JDBC driver but a special purpose library. You cannot use it as a drop-in replacement and would have to re-factor all of your database code if you did. Rather than support SQL statements, you have to create database objects and invoke methods on those objects to interact with the database. – PeterToTheThird Nov 12 '12 at 15:23

5 Answers5

6

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.

jtahlborn
  • 50,774
  • 5
  • 71
  • 112
Jeff Knecht
  • 2,477
  • 1
  • 13
  • 11
4

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.

vanje
  • 9,404
  • 2
  • 31
  • 41
  • 1
    Jet has been superseded by its successor, ACE, which is really just an upgrade to Jet. All of what you say still applies, but your answer would be more complete if you incorporated the ACE reference. – David-W-Fenton Nov 30 '10 at 01:04
  • This answer is outdated. See [this answer](http://stackoverflow.com/a/30104041/2144390) for a free open-source JDBC driver for Access databases ([UCanAccess](http://ucanaccess.sourceforge.net/site.html)). More information available from [this question](http://stackoverflow.com/q/21955256/2144390). – Gord Thompson May 07 '15 at 14:59
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.

lu_ko
  • 3,375
  • 1
  • 23
  • 28
2

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 ...

Jon Martin Solaas
  • 737
  • 1
  • 10
  • 19
0

We use stelsMDB JDBC driver at our server to read/write MDB files. It is platform-independent, so you can use it in MacOS as well.

serg kunz
  • 317
  • 1
  • 3
  • 8