具有绝对路径的 JTDS(到 Access MDB 文件的 JDBC 连接)
我花了很多时间搜索这个问题的解决方案,尝试过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jTDS 仅用于连接到正在运行的 Microsoft 或 Sybase SQL 服务器。
它无法读取或写入(本地)MDB 文件。
通过 JDBC 驱动程序连接到 Access 数据库的唯一方法是使用带有如下 url 的 JDBC/ODBC 桥:
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:
开始使用 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.