How to connect SQLite with Java?
You need to have a SQLite JDBC driver in your classpath.
Taro L. Saito (xerial) forked the Zentus project and now maintains it under the name sqlite-jdbc. It bundles the native drivers for major platforms so you don't need to configure them separately.
If you are using netbeans Download the sqlitejdbc driverRight click the Libraries folder from the Project window and select Add Library ,then click on the Create button enter the Library name (SQLite) and hit OK
You have to add the sqlitejdbc driver to the class path , click on the Add Jar/Folder.. button and select the sqlitejdbc file you've downloaded previously Hit OK and you are ready to go !
If you are using Netbeans
using Maven
to add library is easier. I have tried using above solutions but it didn't work.
<dependencies> <dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId> <version>3.7.2</version> </dependency></dependencies>
I have added Maven
dependency and java.lang.ClassNotFoundException: org.sqlite.JDBC
error gone.