Connecting to SQL databases using jOOQ
jOOQ is a persistence framework that allows you to define SQL queries using the Java Programming Language. It has many capabilities and this section, we will only show a few of them.
As always, you can start by adding the required dependencies to start using jOOQ:
<dependency> <groupId>org.jooq</groupId> <artifactId>jooq</artifactId> <version>3.9.5</version> </dependency> <dependency> <groupId>org.jooq</groupId> <artifactId>jooq-codegen</artifactId> <version>3.9.5</version> </dependency>
Note
You can find all the code developed in this section in the Data-centric-Applications-with-Vaadin-8/chapter-06/jooq-example
Maven project.
Defining a database connection
You can use jOOQ with any connection pool you prefer. The example for this section uses the same approach we used with plain JDBC, so the connection properties can be defined in a datasource...