Juh_
Juh_

Reputation: 15549

Simple embedded database with spring

How to setup a simple embedded database in a spring(data)+maven project?

I need to develop a simple graphical application that read some data files and display pretty stuff about it interactively. The data is very repetitive with a little hierarchical structure. However I still don't know how I will need to access it.

For these reasons, I want to store it in a database so that I can later use DB query to access the data with query filter. (it also seems a good idea to develop a persistent layer)

Because it is for a little application, I want to use an in-memory DB.

I am quite new to java (using proper dev framework) and database. But I worked on a project using spring, spring-data, JPA, etc... I did not really understand how it worked internally and would not be able to setup it up, but I found it very practical.

Now, I found lots of docs and tutorial on internet about that, but I didn't understand enough to know how to adapt them to my need. What (I think) I want is:

What I fill to be lost with are:

I found this project https://github.com/wrpinheiro/spring-jpa-embedded-db that looks to fit, but:

Upvotes: 0

Views: 1742

Answers (1)

zpontikas
zpontikas

Reputation: 5682

I think that if you look at this project you can start building what you need http://spring.io/guides/gs/accessing-data-rest/#initial

Its maven (or gradle), has enbeded db, spring-jpa and runs as a jar that starts its own tomcat server (you can change it into a war build if you want)

Also you can use this service(?) that spring provides to create the starting build for your project: http://start.spring.io

You provide them with what you want to build and then the code and required files are generated :D Pretty neat.

Upvotes: 1

Related Questions