具有绝对路径的 JTDS(到 Access MDB 文件的 JDBC 连接)

发布于 2024-11-18 20:01:55 字数 387 浏览 5 评论 0原文

我花了很多时间搜索这个问题的解决方案,尝试过 Google、BING、尝试过 JTDS 社区但没有解决方案,或者也许我搜索得还不够,但这就是我的情况:

我的项目中有 JTDS 库,并且想要连接到位于本地文件夹 (C:\path\to\databasefile.mdb) 的本地 MDB 数据库文件,但我看到的是我需要以下连接字符串:

"jdbc:jtds:sqlserver://url:port[;option1]..."

我想使用类似这样的内容:

"jdbc:jtds:sqlserver://[C:\\path\to\databasefile.mdb]:port[;option1]..."

是否可以?

I've spent lots of time searching a solution to this, tried Google it, BING it, tried JTDS community but no solution, or maybe I haven't searched enough, nevertheless this is my situation:

I have the JTDS library in my project, and want to connect to a local MDB database file located at a local folder (C:\path\to\databasefile.mdb), but all I see is that I need the following connection String:

"jdbc:jtds:sqlserver://url:port[;option1]..."

I want to use something like this:

"jdbc:jtds:sqlserver://[C:\\path\to\databasefile.mdb]:port[;option1]..."

is it possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深者入戏 2024-11-25 20:01:55

jTDS 仅用于连接到正在运行的 Microsoft 或 Sybase SQL 服务器
它无法读取或写入(本地)MDB 文件。

通过 JDBC 驱动程序连接到 Access 数据库的唯一方法是使用带有如下 url 的 JDBC/ODBC 桥:

jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\path\to\databasefile.mdb

jTDS is only there to connect to a running Microsoft or Sybase SQL Server.
It cannot read or write (local) MDB files.

The only way you can connect to an Access database through a JDBC driver is to use the JDBC/ODBC bridge with an url like this:

jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\path\to\databasefile.mdb
叹梦 2024-11-25 20:01:55

开始使用 Jackcess... http://jackcess.sourceforge.net/

我需要一个解决方案来阅读/写访问本地数据库,64 位计算机上的 jdbc-odbc 桥无法完成此操作。

Moved into using Jackcess... http://jackcess.sourceforge.net/

I needed a solution to read/write access local databases, which a jdbc-odbc bridge on a 64 bit machine cannot be accomplished.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文