java 带有 ms-access 的 JDBC?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9863482/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 22:41:33  来源:igfitidea点击:

JDBC with ms-access?

javams-accessjdbc

提问by user460920

How to connect to a Microsoft Access-based database in a Windows using JDBC code?

如何在 Windows 中使用 JDBC 代码连接到基于 Microsoft Access 的数据库?

What syntax is to be written for Type-1 and Type-4 types of the drivers?

为 Type-1 和 Type-4 类型的驱动程序编写什么语法?

Class.forName(" ");

Is the above syntax different for everytype of the driver we use? How can we define and identify the type of the driver we use??

对于我们使用的每种类型的驱动程序,上述语法是否不同?我们如何定义和识别我们使用的驱动程序的类型?

If possible then also specify for the oracle also the driver syntax to be loaded..

如果可能的话,还要为 oracle 指定要加载的驱动程序语法。

回答by Micha? Niklas

You can use JDBC-ODBC bridge by calling:

您可以通过调用使用 JDBC-ODBC 桥:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")

Then you can use JDBC database URL in form:

然后你可以使用 JDBC 数据库 URL 的形式:

jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\Nwind.mdb

or if you configure your database in ODBC manager you can use its alias:

或者如果您在 ODBC 管理器中配置您的数据库,您可以使用它的别名:

jdbc:odbc:northwind

回答by T Hallman

I recommend a cross-platform Access JDBC driver called UCanAccess. It works great and there are lots of examples on the site (to help the original poster.)

我推荐一个名为UCanAccess的跨平台 Access JDBC 驱动程序。它工作得很好,网站上有很多例子(以帮助原始海报。)

回答by serg kunz

JDBC/ODBC driver is a platform dependent and can be used only in Windows OS. Also, there are some platform independent JDBC drivers, for example: StelsMDB JDBC driver (http://www.csv-jdbc.com/stels_mdb_jdbc.htm)

JDBC/ODBC 驱动程序依赖于平台,只能在 Windows 操作系统中使用。此外,还有一些与平台无关的 JDBC 驱动程序,例如:StelsMDB JDBC 驱动程序(http://www.csv-jdbc.com/stels_mdb_jdbc.htm

回答by user2320365

To connect Java with MS Access, you need a JDBC driver. I still don't think Microsoft do one do they! http://www.easysoft.com/applications/microsoft-access/jdbc-odbc.html

要将 Java 与 MS Access 连接,您需要一个 JDBC 驱动程序。我仍然不认为微软会这样做! http://www.easysoft.com/applications/microsoft-access/jdbc-odbc.html