通过 JDBC 访问 Access(使用 ODBC?) [英] Accessing Access over JDBC (using ODBC?)

查看:31
本文介绍了通过 JDBC 访问 Access(使用 ODBC?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种在 Java 应用程序中打开 Access MDB 文件的方法(使用 JDBC).

I'm looking for a way to open an Access MDB file inside a Java App (using JDBC).

一个快速的谷歌搜索表明我需要 JDBC-ODBC 桥...

A quick Google Search suggests that I need the JDBC-ODBC Bridge for this...

这是否意味着我需要配置我想要运行我的应用程序的每个系统,以便为我想要打开的 MDB 提供一个 ODBC DSN?

Does this mean that I need to configure every system I want to run my app on to provide a ODBC DSN for the MDB I want to open?

还有一个问题(因为我以前从未使用过 ODBC):通信是通过某种套接字(客户端/服务器样式)还是通过方法/函数调用(例如使用嵌入式 Derbydb)?

And one more question (since I've never used ODBC before): will the communication happen over some sort of a socket (in a client/server-style), or through method/function calls (like with an embeded Derby db)?

推荐答案

1) 您无需使用 SYSTEM 或 USER ODBC DSN 配置每个系统来访问您想要的 MDB.您仍然可以在 JDBC URL 中提供您需要的所有信息:

1) You won't need to configure every system with a SYSTEM or USER ODBC DSN to access the MDB you want. You can still provide all the information you need in your JDBC URL:

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

但请记住,系统需要安装您正在使用的驱动程序.

But keep in mind that the system will need to have the driver you are using installed.

2) 通信将按照 ODBC 驱动程序通信的方式进行.如果它打开一个到服务器的套接字(Oracle ODBC 连接发生的方式),它将打开一个套接字.如果它使用库函数调用,它将通过库函数调用进行通信.

2) The communication will happen the way your ODBC driver communicates. If it opens a socket to the server (the way an Oracle ODBC connection takes place) it will open a socket. If it uses library function calls, it will communicate through library function calls.

JDBC 到 ODBC 通信使用 JNI 进行通信.

JDBC to ODBC communication uses JNI to communicate.

这篇关于通过 JDBC 访问 Access(使用 ODBC?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆