JavaFX java.lang.ClassNotFoundException: org.sqlite.JDBC

Answered

I was working on Eclipse and NetBeans, and I was able to create/connect sqlite database by this:

Class.forName("org.sqlite.JDBC");
Connection conn = DriverManager.getConnection("jdbc:sqlite:dbTest.db");

but when I tried to work on Intellij IDEA I get this exception
java.lang.ClassNotFoundException: org.sqlite.JDBC

I tried then to create an sqlite database (Sqlite (Xerial)) and installed its drivers and the clicked on "Test Connection",
and the connection was successful, but still don't know to to connect to it.
My question is: What are the ways to connect to sqlite databases?

1 comment

You need to have jdbc driver jar in the classpath of your aplication to use it for connection from the java code. Download jdbc driver jar for SQLite database and add it as a dependency to the module.

1

Please sign in to leave a comment.