Trying to use UCanAccess to open an Access database with Java but it doesn't seem to be working. Here is the code:
import java.sql.*;
public class DbAccess2
{
public static void main(String[] args)
{
try
{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
Connection conn=DriverManager.getConnection("jdbc:ucanaccess://c:/myDB.mdb");
Statement s = conn.createStatement();
System.out.println("OK");
}
catch(Exception ex)
{
ex.printStackTrace();
// System.out.print("Not OK");
}
}
}
Here is the error I get:
java.lang.ClassNotFoundException: net.ucanaccess.jdbc.UcanaccessDriver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at DbAccess2.main(DbAccess2.java:10)
BUILD SUCCESSFUL (total time: 0 seconds)
Here's what my file looks like (NetBeans)
You have the UCanAccess jar file and its dependencies in a folder named lib
under "Libraries". Normally those jar files reside in "Libraries" itself, along with the JDK. It looks you unpacked a bunch of stuff and then tried to just add the folder, but that doesn't work: you need to add the actual jar files (not the folder they live in). See the NetBeans screenshot in this answer for an example.
How to get gross revenue data from woocommerce by product ID?
Is it possible to use two (non-nested) for loops inside a dicitonary?
Dashboard Header button and footer button not getting aligned properly in concrete 5
Laravel 8 - Automatically update a form field when certain value is selected
I get JSON object after asking restfb API with fetchObject methodI need to somehow handle the fact, that when user types in:
Oddly enough individuals are allowed to go to the edges of my progress bar in the bottom right of this picture and move the progress bar left and right:
I want to convert a time in the below format into hours