Using JdbcTemplate with Spring Boot

Introduction Spring Boot provides support to typical JDBC operations via jdbcTemplate. With JDBC templates, you can perform complex database operations which are not possible through JPA. Starter Dependencies JDBC templates feature is part of the Spring JDBC module. This means that either the JPA starter or the JDBC starter will bring this support. As we…

Derby Embedded Database for Spring Boot

In this post, We will see how we can use Apache Derby embedded database with Spring Boot applications with an example. Introduction Apache Derby is a pure java implementation of a relational database. Also, it complies to JDBC and RDBMS standards. For this reason, we can easily embed Derby into applications. Derby Dependencies for Spring…

Spring Boot H2 Database

Introduction Let’s learn how to use the h2 database with the spring boot application and its configuration via application properties. H2 is an in-memory database that we can embed within the application. For this reason, H2 is the right candidate for loading test data or to prototype an application. Spring Boot Dependencies Spring Boot doesn’t…

Drools Rule Engine for Spring Boot – Tutorial

Lets learn how to integrate Drools Rule Engine with Spring Boot application for business rules management with an Example. Drools is a Business Rule Engine that is based on Java Rules API. It lets you create complex applications where the business logic changes a lot post development. Introduction To Drools For example, you may run…

Spring @Async to increase performance in 3 steps

Lets learn about Spring Boot @Async annotation and use it to achieve Async (asynchronous) method execution in Spring Boot. Introduction to @Async annotation Normally, A program would run from top to bottom. But sometimes, one operation or method may take time and it would cause other methods to wait. In these cases, it makes sense…

Enums in Thymeleaf templates

In this post, We will take a look at how we can use enums in thymeleaf with examples. Select tag in HTML is usually a form input with a set of pre-defined options. Even though it is common to hard code these values, thymeleaf can offer you much more leverage with Enum support. Let’s see how we can…

Boolean in Thymeleaf for Conditional Evaluation

Thymeleaf relies a lot on boolean conditionals to render the HTML views. In this post, we will see how thymeleaf handles boolean values using th:if and th:unless directives. Boolean expressions in Thymeleaf In Thymeleaf, all expressions can act as a Boolean expression. For example, The following values are considered false. An expression or a literal…

Handling Lists in Thymeleaf view

In this article, We will see how to handle Lists in thymeleaf templates with an example using th:each attribute. Loop through a Lists Let’s create a list of Objects first and then supply it to the Model and View. For this reason, We created a UserInfo object. The list we are going to use in our thymeleaf model is…

Thymeleaf CRUD web Application with Example

In this post, We will try to create a Simple Thymeleaf CRUD web application using Spring Boot. A CRUD application lets you Create, Read, Update and Delete things like files, database entries etc. With the help of JPA repositories and their built-in methods, it’s easy implement this. In this guide, we’ll learn how to build a CRUD web application with…

Customizing Spring Session Cookies

In this post, We will take a look at Customizing Spring Session Cookies with an example. Typical behaviour In session-based authentications like Form-Login and CAS(Central Authentication System), the session is established via cookies. This is done by sending a Set-Cookie header after a successful login similar to the one shown below. Once the browser reads this response…