AI Features

Working with Databases

Learn how to connect to a database in the Vert.x application using Kotlin language.

To be able to progress further with our tests, we need the ability to create entities in the database. For that, we’ll need to connect to the database.

First, let’s add the following two lines to our build.gradle.kts dependencies section:

implementation("org.postgresql:postgresql:42.3.0")
implementation("io.vertx:vertx-pg-client:$vertxVersion")

The first line of code fetches the PostgreSQL driver. The second one ...