我正在努力让 Squirrel SQL 连接到 MS Access 数据库(只是一个普通的,没有密码):
- 我创建了一个别名并使用驱动程序:JBDC ODBC 桥(这个驱动程序前面有一个勾号)
- 我不知道在 URL 中输入什么
- -------- 我使用:数据库文件的路径 ~~> 不成功
- -------- 我使用:jdbc:odbc:Path to database file ~~> 不成功
- 我在 Windows 7 上运行它。
我来宾这应该是一个简单直接的过程,但请告诉我如何让它工作。
我正在努力让 Squirrel SQL 连接到 MS Access 数据库(只是一个普通的,没有密码):
我来宾这应该是一个简单直接的过程,但请告诉我如何让它工作。
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.
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.
In Squirrel SQL, create a new "Driver" entry for UCanAccess
and specify the location of loader/ucanload.jar on the "Extra Class Path" pane
Note: Remember to enter net.ucanaccess.jdbc.UcanloadDriver
as the "Class Name" (see above).
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
or, in Windows
Important: Make sure that the connection URL ends with ;showSchema=true
.
我找到了解决方案。将以下字符串放入 URL:
(假设您的数据库文件的路径是 D:\DBs\DatabaseFile.mdb)
jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=D:\DBs\DatabaseFile.mdb