How to debug SQL statements in Spring Boot applications

Spring boot auto-configuration does not require a dedicated logging configuration file. So, in order to debug your SQL Statements in Spring Boot applications, by default can use the following settings in your application.properties file: logging.level.org.hibernate.SQL=DEBUG logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE When this configuration is added, you will be able to see: 1) Each SQL Statement executed 2) The timing … Read more

GraphQL tutorial for Spring Boot developers

GraphQL is a specialized query language which gives us an alternative a more flexible approach to managing data in our application than restful design. In this tutorial we will learn how to use GraphQL with a Spring Boot application.

Read more

How to add initial data in Spring Boot JPA applications

In order to have some data inserted at application start up, all you have to do is creating a data.sql file in your src/main/resources folder and it will be automatically executed on startup. Within this file, place your SQL INSERT Statements: INSERT into CUSTOMER(id,name,surname) VALUES (1,’aaaa’,’bbbbbb’) INSERT into CUSTOMER(id,name,surname) VALUES (2,’cccc’,’dddddd’) On the other hand, … Read more

Create a JPA Application using Groovy and Spring Boot

You can create a Spring Boot application using Groovy either from the IDE or using the online Spring Boot application generator http://start.spring.io and selecting Groovy as the language. You’ll now see how to develop a simple Spring Boot web application using Groovy, Spring Data JPA, and Thymeleaf. Add the Web, Thymeleaf, JPA, and H2 starters … Read more

How to connect to H2 Console in Spring Boot

In order to enable H2 In-Memory Database in Spring Boot applications you have to include the “h2” dependency in your initializer. For example: spring init -dweb,jpa,h2 demo-h2 The H2 Database provides a web interface called H2 Console to see the data. You can enable the h2 console in the src/main/resources/application.properties # Enabling H2 Console spring.h2.console.enabled=true … Read more

Configuring SpringBoot to use MySQL

In this tutorial we will learn how to create a basic application using Spring Boot CLI and MySQL as database. We will then import the application into an IDE to create a sample application which stores some data which is later retrieved by the SpringApplication class.

Read more