简体   繁体   中英

java.lang.ClassNotFoundException: org.sqlite.JDBC

I have added sqlite jar in lib folder into project and i also added into build path but still i'm getting "java.lang.ClassNotFoundException: org.sqlite.JDBC" exception.

here is conection code.

try {
    String path = OsSpecificseperator.getPath(Platform.getInstallLocation().getURL().getPath());
    Class.forName("org.sqlite.JDBC");
    connection = DriverManager.getConnection("jdbc:sqlite:" + path+"configuration/tools/KidProject_Database");
} catch (Exception e) {
    e.printStackTrace();
    System.out.println("DB : Connection: " + e.getMessage());
    return;
}

I would think that Class.forName("org.sqlite.JDBC") is expecting a class name. It looks like you're providing it a package name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM