Partner – DBSchema – NPI (tag=SQL)
announcement - icon

DbSchema is a super-flexible database designer, which can take you from designing the DB with your team all the way to safely deploying the schema.

The way it does all of that is by using a design model, a database-independent image of the schema, which can be shared in a team using GIT and compared or deployed on to any database.

And, of course, it can be heavily visual, allowing you to interact with the database using diagrams, visually compose queries, explore the data, generate random data, import data or build HTML5 database reports.

>> Take a look at DBSchema

Partner – Trifork – NPI (cat=Spring Boot)
announcement - icon

Navigating the complexities of Spring can be difficult, even for seasoned developers.

If you need direct, practical help and guidance with your own Spring work, Trifork's CTO, Joris Kuipers, is running a closed-door call.

It's free, but it's limited to only 3 seats, so if you need it, I would join quickly and be sure to attend:

>>> CTO Spring Open Office Hour Session - Technical Guidance

With more than 15 years of leading custom software development projects involving Spring, Joris has gained a lot of real-world experience, and this call is about sharing and helping the community.


Course – LSD (cat=Persistence)

Get started with Spring Data JPA through the reference Learn Spring Data JPA course:


1. Overview

In this quick tutorial, we'll go through the steps to use an SQLite database in a JPA-enabled Spring Boot application.

Spring Boot supports a few well-known in-memory databases out of the box, but SQLite requires a bit more from us.

Let's have a look at what it takes.

2. Project Setup

For our illustration, we'll start with a Spring Data Rest app we've used in past tutorials.

In the pom, we need to add the sqllite-jdbc dependency:


This dependency gives us what we need to use JDBC to communicate with SQLite.

3. SQLite Dialect

From Hibernate 6, SQLite dialect is supported.

We have to import in our pom.xml:


And in our application properties:

4. DataSource Configuration

Also, since Spring Boot doesn't provide configuration support for SQLite database out of the box, we also need to expose our own DataSource bean:

@Autowired Environment env;

public DataSource dataSource() {
    final DriverManagerDataSource dataSource = new DriverManagerDataSource();
    return dataSource;

And finally, we'll configure the following properties in our file:


Note that we need to keep the cache as shared in order to keep the database updates visible across multiple database connections.

So, with the above configurations, the app will start and will launch an in-memory database called myDb, which the remaining Spring Data Rest configuration can take up.

5. Conclusion

In this article, we took a sample Spring Data Rest application and pointed it at an SQLite database. However, to do so, we had to create a custom Hibernate dialect.

Make sure to check out the application on Github. Just run with mvn spring-boot:run and browse to http://localhost:8080.

Course – LSD (cat=Persistence)

Get started with Spring Data JPA through the reference Learn Spring Data JPA course:

res – Persistence (eBook) (cat=Persistence)
Comments are closed on this article!