将文件 DSN 与 JDBC 结合使用
我可以愉快地使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用无 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?