简体   繁体   English

MS ACCESS(.mdb)数据库的类型4 JDBC驱动程序?

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

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 我的Java应用程序使用.mdb数据库,我想在MAC OS上运行这个应用程序,这肯定会有一个TYPE 4 JDBC驱动程序,我有谷歌,并遇到了两个 - HXTT和StelsMDB,但两者都超出我的范围

So if any body has some alternative or suggestions please reply. 因此,如果任何机构有一些替代或建议,请回复。

Thanks in advance 提前致谢

I've used jackcess to read the tables from an MDB and convert the database to sqlite3. 我使用jackcess从MDB读取表并将数据库转换为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. 如果您需要保留.mdb格式,这并不理想,但它允许我将数据库保存在单个文件中并使数据库跨平台。

MS Access databases on MS Windows are driven by the Microsoft Jet Engine . MS Windows上的MS Access数据库由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. 与MS SQL Server或MySQL等客户端服务器数据库管理系统不同,与MS Access数据库的连接通过OLE和某些DLL以嵌入模式运行。

As far as I know there is no Jet Engine implementation for operating systems other than MS Windows. 据我所知,除了MS Windows之外,没有针对操作系统的Jet Engine实现。 So if you want to connect to a MDB file on Mac OS a simple JDBC driver is not enough. 因此,如果要在Mac OS上连接到MDB文件,仅使用简单的JDBC驱动程序是不够的。 There has to be some kind of emulation layer to emulate the Jet Engine DLLs. 必须有某种仿真层来模拟Jet Engine DLL。 According to the HXTT website this is exactly the way the HXTT JDBC driver works. 根据HXTT网站,这正是HXTT JDBC驱动程序的工作方式。

From the HXTT website: 来自HXTT网站:

It contains a fast database engine written in Java, which supports embedded and server modes. 它包含一个用Java编写的快速数据库引擎,它支持嵌入式和服务器模式。

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. 如果MS Access数据库格式的使用是绝对必要的,那么这种模拟可能是最适合您的方式。 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.) (也许无法访问MDB文件中包含的VBA宏。)

It seems there is no open source project doing the same kind of emulation like HXTT. 似乎没有开源项目像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), SQLite此JDBC驱动程序支持Mac Os)(一个数据库文件,需要一些本机库),
  • H2 (only a few database files, pure Java) or H2 (只有少数数据库文件,纯Java)或
  • Apache Derby (many database files, pure Java). Apache Derby (许多数据库文件,纯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. 或者,您可以使用客户端服务器数据库管理系统,在主机上安装服务器并从Mac OS计算机连接到该主机。 For that you can use for example 为此你可以使用例如

Even the pure Java databases H2 and Derby have client server modes. 即使是纯Java数据库H2和Derby也有客户端服务器模式。

I suppose UCanAccess is what you are looking for. 我想UCanAccess就是你想要的。

It is an open source Java JDBC Driver implementation which allows Java developers and jdbc client programs (eg, DBeaver, NetBeans, SQLeo, Open Office Base, Libre Office Base, Squirrell) to read/write Microsoft Access database . 它是一个开源Java JDBC驱动程序实现,它允许Java开发人员和jdbc客户端程序(例如,DBeaver,NetBeans,SQLeo,Open Office Base,Libre Office Base,Squirrell) 读/写Microsoft Access数据库 Because it is a pure java implementation it run in both Windows and non-Windows Operative Systems (eg, linux/unix). 因为它是纯Java实现, 所以它在Windows和非Windows操作系统(例如,linux / unix)中运行。 No ODBC needed. 不需要ODBC。

StelsMDB is not as expensive as HXTT, still not open source... StelsMDB并不像HXTT那样昂贵,仍然不是开源的......

http://www.csv-jdbc.com/stels_mdb_jdbc.htm 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 ... 不应该在jaccess之上建立......

We use stelsMDB JDBC driver at our server to read/write MDB files. 我们在服务器上使用stelsMDB JDBC驱动程序来读/写MDB文件。 It is platform-independent, so you can use it in MacOS as well. 它与平台无关,因此您也可以在MacOS中使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM