java MS ACCESS(.mdb) 数据库的类型 4 JDBC 驱动程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4284661/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Type 4 JDBC driver for MS ACCESS(.mdb) database?
提问by Jinith
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
提前致谢
回答by Jeff Knecht
I've used Hymancessto 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.
我使用Hymancess从 MDB 读取表并将数据库转换为 sqlite3。如果您需要保留 .mdb 格式并不理想,但它允许我将数据库保存在单个文件中并使数据库跨平台。
回答by vanje
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.
MS Windows 上的 MS Access 数据库由Microsoft Jet 引擎驱动。与 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. 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 websitethis is exactly the way the HXTT JDBC driver works.
据我所知,除了 MS Windows 之外,没有其他操作系统的 Jet Engine 实现。因此,如果您想在 Mac OS 上连接到 MDB 文件,一个简单的 JDBC 驱动程序是不够的。必须有某种模拟层来模拟 Jet Engine DLL。根据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. 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.)
如果绝对需要使用 MS Access 数据库格式,那么这些模拟可能是您的最佳方式。但是你要证明兼容级别是否足够高。(也许无法访问 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 driversupports 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).
- SQLite(这个JDBC驱动支持Mac Os)(一个数据库文件,需要一些原生库),
- H2(只有几个数据库文件,纯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. For that you can use for example
或者您可以使用客户端服务器数据库管理系统,在主机上安装服务器并从您的 Mac OS 计算机连接到该主机。为此,您可以使用例如
Even the pure Java databases H2 and Derby have client server modes.
即使是纯 Java 数据库 H2 和 Derby 也有客户端服务器模式。
回答by lu_ko
I suppose UCanAccessis what you are looking for.
我想UCanAccess正是您要找的。
It is an open source Java JDBC Driverimplementation 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.
它是一个开源 Java JDBC 驱动程序实现,它允许 Java 开发人员和 jdbc 客户端程序(例如 DBeaver、NetBeans、SQLeo、Open Office Base、Libre Office Base、Squirrell)读/写 Microsoft Access 数据库。因为它是一个纯 Java 实现,所以它可以在 Windows 和非 Windows 操作系统(例如,linux/unix)中运行。不需要 ODBC。
回答by Jon Martin Solaas
StelsMDB is not as expensive as HXTT, still not open source...
StesMDB没有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 之上构建应该不是不可能的......
回答by serg kunz
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.
我们在我们的服务器上使用 stelsMDB JDBC 驱动程序来读/写 MDB 文件。它与平台无关,因此您也可以在 MacOS 中使用它。