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


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

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
Comment actions Permalink

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.


Please sign in to leave a comment.