Log4j2 JDBCAppender

Learn to configure the Log4j2 provided JDBCAppender that writes log events to a relational database table using standard JDBC. The JDBCAppender obtains the database connection from a configured connection factory or JNDI datasource. Then it uses the provided column configuration to insert a new row in the log table, everytime a log statement is executed. … Read more

Spring Boot and Vaadin CRUD Example

Vaadin is a Java framework that simplifies front-end development by providing a rich set of reusable UI components and layouts. In this Spring Boot and Vaadin tutorial, we will explore the process of developing a basic CRUD application. 1. Goals Our goal is to construct a user interface that includes a table displaying the list … Read more

Spring Boot @ServiceConnection

Since Spring Boot 3.1, @ServiceConnection is used to provide connection details to a remote service that takes precedence over details in the properties file.

Spring Security Interview Questions

If you’re preparing for a job interview, these Spring security interview questions will help you understand key concepts and increase the confidence.

Redis Pub/Sub with Spring Boot Data

Learn to use Redis Pub/Sub with Spring Boot Data, and configure the message publishers and subscribers (listners) for a given channel topic.

Spring Security Tutorial

In Spring security tutorial, learn how it works under the hood, concepts of authentication, authorization, access control and basic configurations.

Getting Started with Keycloak on Docker

Learn the installation of the Keycloak authorization server as a docker container and different configurations for setting up the realm and testing the authorization token flow.

Configure Multiple DataSources in Spring Boot

In this post, we will learn how to configure and manage multiple datasources using properties configuration and defining custom beans using Java annotations in Spring Boot. Note that this requirement differs from having separate datasource in test, dev and prod environments. Here, we are using multiple datasources in the same environment and each datasource can … Read more

Spring Boot – Separate DataSource for Test, Dev and Prod

Learn to configure and use different DataSource in different environments (test, development, production etc.) using the Spring profile specific properties files, as well as Java configuration in a Spring boot application. 1. Introduction A production grade application is deployed and tested in different environments before finally released to the end-user. In these environments, application must … Read more

Spring Batch Tutorial

Spring batch is a lightweight, comprehensive framework designed for the development of robust batch processing applications. Learn with examples.

SQL Interview Questions with Answers

This guide lists out a few of the most asked SQL interview questions and gives their answers such as JOINS, KEYWORDS, TRIGGERS and much more.

Java Versions and Features [Updated upto Java 22]

On this page, we will frequently list the major feature changes in the latest Java release, sequentially. Though we have tried to cover as much information as possible, if you know something we have missed below, please let me know, and we will add that information. Java 22 Features Java 22 has been released on … Read more

Spring Boot Profiles

Learn about Spring profiles, @Profile, profile-specific beans and properties, profile groups and activating a certain profile during startup.

Accessing Properties in Spring Boot

Learn to use @PropertySource, @Value and @ConfigurationProperties annotations to register property files and inject configuration properties.

Password Encoders in Spring Security

Learn the contract spring security expects from PasswordEncoder interface, inbuilt implementations and DelegatingPasswordEncoder with examples.

Java Logging

This Java logging series lists down all tutorials posted under logging frameworks such as Log4j2 and Logback, for quick references.

Log4j2 Tutorial

Log4j2 provides significant improvements over its predecessor Log4j. Read about its xml and properties configuration and various examples.

Hibernate Tutorials

These tutorials have been published to help you start with persistence with Hibernate and JPA. These are updated to version Hibernate 6.x.

Mocking an In-memory JNDI DataSource

Learn to create and inject an in-memory DataSource that can be used to mock J2EE container provided JNDI DataSource without running a server.

Batch Processing with Hibernate/JPA

Learn to execute bulk SQL INSERT and UPDATE statements using Hibernate / JPA batch processing, and to configure session-specific batch sizes.

Stored Procedures with Hibernate

Hibernate provides support for executing the stored procedures and capturing their outputs using StoredProcedureQuery and ProcedureCall APIs.

Guide to Pagination with Hibernate

Learn to implement and test the pagination functionality in hibernate using the HQL setFirstResult(), setMaxResults() and ScrollableResults.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.

Our Blogs

REST API Tutorial

Dark Mode

Dark Mode