I am trying to make a basic JDBC program using MS Access. I downloaded the Ucanacess.zip file and I got in total 6 .jar files namely: ucanaccess-3.0.7, ucanload, commons-lang-2.6, commons-logging-1.1.1, hsqldb, and jackcess-2.1.3
I added them to the classpath as Environment Variables(Computer->Properties->Advanced System Settings->Environment Variable).
But when I run my Code it gives an Exception java.lang.ClassNotFoundException: net.ucanaccess.jdbc.UcanaccessDriver
Here is the code
class DB {
public static void main(String[] args) {
try {
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
}
catch(ClassNotFoundException ex) {
System.out.println(ex);
}
}
}
You have to run :
The former to compile DB.java. The latter to run java by setting classpath, "." is the directory where resides the compiled "DB.class"