Skip to content

guide quarkus configuration

devonfw-core edited this page Aug 31, 2021 · 8 revisions

Configuration

External Application Configuration

Database Configuration

In Quarkus, Hibernate is provided by the quarkus-hibernate-orm extension. Ensure the extension is added to your pom.xml as follows:

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-hibernate-orm</artifactId>
</dependency>

You additionally have to add the respective JDBC driver extension to your pom.xml. There are different drivers for different database types. See Quarkus Hibernate guide.

Database System and Access

You need to configure which database type you want to use, as well as the location and credentials to access it. The defaults are configured in application.properties. The file should therefore contain the properties as in the given example:

  quarkus.datasource.jdbc.url=jdbc:postgresql://database.enterprise.com/app
  quarkus.datasource.username=appuser01
  quarkus.datasource.password=************
  quarkus.datasource.db-kind=postgresql

  # drop and create the database at startup (use only for local development)
  quarkus.hibernate-orm.database.generation=drop-and-create

Database Logging

Add the following properties to application.properties to enable logging of database queries for debugging purposes.

quarkus.hibernate-orm.log.sql=true
quarkus.hibernate-orm.log.format-sql=true

#Logs SQL bind parameters. Setting it to true is obviously not recommended in production.
quarkus.hibernate-orm.log.bind-parameters=true
Clone this wiki locally