Java SQLite Tutorial

By | April 7, 2016

In this tutorial you will learn about Java SQLite.

SQLite is lightweight, zero configuration, serverless SQL database library. In this tutorial I will teach you how to use SQLite database with Java.

Note: I have made this tutorial using Eclipse. Because it is easier to import library in an IDE.

First off all you need to download the SQLite JDBC library or jar. Download it from below link.


Now just import it into your project. If you don’t know how to import library in Eclipse then follow below link.

Java SQLite Tutorial

Java SQLite Tutorial

Connection with Database

Below example shows how you can connect Java with SQLite database. Here demo.db is the database name, you can change it according to you. If the database doesn’t exists then it will be created.


On successful connection the program show output “Connection established” otherwise “Some error occurred”.


Java SQLite Example

The below program first establish connection with SQLite database, create a table, insert some record in it and then finally display the records. This shows that how you can work with SQLite using Java.



Java SQLite Tutorial Output

So this was the simple Java SQLite tutorial. You can comment below if you are facing any problem.

One thought on “Java SQLite Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *