O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Accessing a database with Spring

We will make a simple application that adds new orders to the database. A user just fills in a name of the order and clicks on the Add New Order button.

The orders will be stored in the in-memory database and it will be easy to switch the database, for example to MySQL. For accessing the database, we use JdbcTempate from Spring framework.

Accessing a database with Spring

Getting ready

Create a new Maven project from the Vaadin archetype.

mvn archetype:generate \ -DarchetypeGroupId=com.vaadin \ -DarchetypeArtifactId=vaadin-archetype-application \ -DarchetypeVersion=LATEST \ -Dpackaging=war \ -DgroupId=com.app \ -DartifactId=vaadin-spring-database \ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required