Reputation: 337
Quite exciting to find this jdbc driver for ms access.
However, when I try to test it with Oracle SQL Developer, I got:
Status : Failure -Test failed: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Quoted from UCanAccess website:
Because it is a pure java implementation it run in both Windows and non-Windows Operative Systems(e.g., linux/unix). No ODBC needed.
What am I missing? Or I must configure ODBC in Windows environment?
Upvotes: 0
Views: 1105
Reputation: 201467
You shouldn't be using an ODBC URL, to open a hypothetical test.mdb in the user's home directory you might use something like
File file = new File(System.getProperty("user.home"), "test.mdb");
Connection conn = DriverManager.getConnection("jdbc:ucanaccess://" +
file.getPath());
The JDBC url begins with jdbc:ucanaccess://
which is followed by the Access database file path.
Finally, make sure you have the required dependencies (which are documented as)
jackcess-2.0.0.jar or later
- commons-lang-2.4.jar
- commons-logging-1.0.4.jar
hsqldb.jar(2.2.5)
Upvotes: 1