# Running SQLite in Pure Java with Quarkus

DevFeed: [Running SQLite in Pure Java with Quarkus](<https://devfeed.tech/articles/running-sqlite-in-pure-java-with-quarkus-43960.md>)

Original publisher: [Read original article](<https://quarkus.io/blog/sqlite4j-pure-java-sqlite/>)

Author: Andrea Peruffo (https://twitter.com/and\_prf)

Published: 2025-03-12T00:00:00Z

Content type: tutorial

Language: en

Sources: [Quarkus - Supersonic Subatomic Java](<https://devfeed.tech/sources/quarkus-supersonic-subatomic-java.md>)

Topics: [SQLite](<https://devfeed.tech/topics/sqlite.md>), [Quarkus](<https://devfeed.tech/topics/quarkus.md>), [Database](<https://devfeed.tech/topics/database.md>), [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [Security](<https://devfeed.tech/topics/security.md>), [WebAssembly](<https://devfeed.tech/topics/web-assembly.md>)

Tags: [aot](<https://devfeed.tech/tags/aot.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [database](<https://devfeed.tech/tags/database.md>), [hibernate](<https://devfeed.tech/tags/hibernate.md>), [in-memory-database](<https://devfeed.tech/tags/in-memory-database.md>), [java](<https://devfeed.tech/tags/java.md>), [orm](<https://devfeed.tech/tags/orm.md>), [quarkus](<https://devfeed.tech/tags/quarkus.md>), [security](<https://devfeed.tech/tags/security.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>)

## AI overview

This tutorial explains how to run SQLite in a pure Java Quarkus application using the quarkus-jdbc-sqlite4j extension. It covers JDBC configuration, Hibernate ORM integration, sandboxed in-memory execution, persistence through scheduled backups, and the WebAssembly-to-Java-bytecode implementation.

## Source excerpt

What if you could run a C-based database in pure Java, with zero configuration, and even compile it to a native image effortlessly? With the new Quarkiverse extension quarkus-jdbc-sqlite4j, you can do exactly that. Traditionally, embedded databases in Java require reimplementing their C counterparts, often leading to differences in behavior, missing optimizations, and delayed bug fixes. However, sqlite4j provides a JDBC driver that leverages the original SQLite C implementation while running safely inside a sandbox. Hands-on Example To see quarkus-jdbc-sqlite4j in action, you can start with any existing Quarkus application or one of the quickstarts. If you prefer a ready-made example, check out this demo repository, which integrates SQLite within a Quarkus application using Hibernate ORM. By simply changing the JDBC driver dependency, you can embed a fully functional SQLite database inside your application while retaining all the benefits of the native SQLite implementation. To get started, add the extension dependency to your pom.xml: <dependency> <groupId>io.quarkiverse.jdbc</groupId> <artifactId>quarkus-jdbc-sqlite4j</artifactId> </dependency> Then, configure your Quarkus application to use SQLite with standard JDBC settings: quarkus.datasource.db-kind=sqlite quarkus.datasource.jdbc.url=jdbc:sqlite:sample.db quarkus.datasource.jdbc.min-size=1 You can now use your datasource as you normally would with Hibernate and Panache. Note that we keep a minimum connection pool size > 0 to avoid redundant copies from disk to memory of the database. Running in a Secure Sandbox Under the hood, SQLite runs in a fully in-memory sandboxed environment, ensuring security and isolation. When a connection to a local file is opened, the following occurs: The database file is copied from disk to an in-memory Virtual FileSystem. A connection is established to the in-memory database. While this approach is highly secure, many users need to persist database changes. One recommended soluti