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 Spring JDBC module. This means that either JPA starter or JDBC starter will bring this support. As we don’t need JPA…

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 To include…

H2 Database for Spring Boot

Introduction In this post, We will take a look at using and configuring h2 database with spring boot application. H2 is an in-memory database which 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 First of all, both…

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…

Handling Enums in Thymeleaf templates

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 do that. Enum Setup An Enum in java is a data type that allows us to define a set of…

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. Boolean expressions in Thymeleaf Everything can be evaluated into boolean in thymeleaf. To categorize, The following values are considered false. An expression or a literal that is false. A String literal that equals…

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…