将文件 DSN 与 JDBC 结合使用

发布于 2024-12-29 20:12:13 字数 325 浏览 0 评论 0原文

我可以愉快地使用 JDBC 连接到系统 DSN:

DriverManager.getConnection("jdbc:odbc:SysDSN");

如果我尝试使用文件 DSN,但会收到错误: [Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序

使用:

DriverManager.getConnection("jdbc:odbc:FileDSN");

我已尝试指定文件 DSN 的路径,但仍然没有得到满意的结果。

I can happily connect to a System DSN using JDBC:

DriverManager.getConnection("jdbc:odbc:SysDSN");

If I try and use a File DSN however I get an error:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Using:

DriverManager.getConnection("jdbc:odbc:FileDSN");

I've tried specifying a path to the File DSN and still get no joy.

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

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

发布评论

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

评论(1

想你的星星会说话 2025-01-05 20:12:13

我建议使用无 DSN 连接 URL,如下所示:

在 Java 中为 MS Access 创建无 DSN 连接

您不必以这种方式创建 DSN。

PS - 在按照您的方式尝试之前,您确实创建了数据源,不是吗?

I'd recommend using an DSN-less connection URL, as shown here:

Creating a DSN-less connection for MS Access within Java

You won't have to create a DSN that way.

PS - You did create the data source before you tried it your way, didn't you?

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