问题描述
我正在努力让Squirrel SQL连接到MS Access数据库(只是一个普通的,没有密码):
I'm struggling to get Squirrel SQL to connect to MS Access database (just a normal one, no password):
- 我创建一个别名并使用驱动程序:JBDC ODBC桥(此驱动程序前面有一个勾号)
- 我不知道要在URL中输入什么
- --------我使用:数据库文件的路径~~>不成功
- --------我使用:jdbc:odbc:数据库文件的路径~~>不成功
- 我正在Windows 7上运行它.
我请客,这应该是一个简单直接的过程,但是请告诉我如何使它正常工作.
I guest this should be a simple straight forward process, but please advise me how to get it working.
推荐答案
现在,JDBC-ODBC Bridge已从Java 8中删除,随着时间的流逝,对该问题的先前答案将变得不那么重要.以下方法使用 UCanAccess JDBC驱动程序,因此它将与Java 8一起使用,并且也可以在非Windows平台.
Now that the JDBC-ODBC Bridge has been removed from Java 8 the previous answer to this question will become less relevant over time. The following method uses the UCanAccess JDBC driver so it will work with Java 8 and it will also work on non-Windows platforms.
首先,请确保您使用的是UCanAccess版本 3.0.5 或更高版本.下载最新版本的UCanAccess驱动程序(bin.zip
文件)并将其解压缩到方便的位置.对于此示例,我将其解压缩为
First, make sure that you are using UCanAccess version 3.0.5 or later. Download the latest version of the UCanAccess driver (bin.zip
file) and unzip it to a convenient location. For this example I unzipped it to
/home/gord/Downloads/JDBC/UCanAccess
注意:解压缩分发文件时,请确保指定保留目录结构"(或类似名称,具体取决于您的解压缩工具),以便文件夹结构如上图所示.
Note: When unzipping the distribution file be sure to specify "Keep directory structure" (or similar, depending on your unzip tool) so the folder structure appears as in the screenshot above.
在Squirrel SQL中,为UCanAccess创建一个新的"Driver"条目
In Squirrel SQL, create a new "Driver" entry for UCanAccess
并在附加类路径"窗格中指定 loader/ucanload.jar 的位置
and specify the location of loader/ucanload.jar on the "Extra Class Path" pane
注意:请记住输入net.ucanaccess.jdbc.UcanloadDriver
作为类名"(见上文).
Note: Remember to enter net.ucanaccess.jdbc.UcanloadDriver
as the "Class Name" (see above).
要打开特定的数据库,请创建一个Squirrel SQL"Alias"条目,将<path_to_database_file>
占位符替换为文件的实际路径
To open a specific database, create a Squirrel SQL "Alias" entry, replacing the <path_to_database_file>
placeholder with the actual path to the file
或者,在Windows中
or, in Windows
重要:确保连接URL以;showSchema=true
结尾.
Important: Make sure that the connection URL ends with ;showSchema=true
.
这篇关于如何配置Squirrel SQL客户端以与MS Access一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!