Spring Boot Quartz Scheduler: Jobs, Triggers, JDBC Store

Schedule jobs in Spring Boot 4 with Quartz 2.5: inject Spring beans into jobs, use simple and cron triggers, handle misfires, chain jobs with listeners, persist and cluster jobs with the JDBC job store, and manage them from the actuator endpoint.

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

GenericJDBCException: Could Not Prepare Statement [Solved]

Hibernate throws GenericJDBCException: could not prepare statement when the driver rejects the SQL and gives no SQLState to classify it. See the real messages from SQLite, H2 and HSQLDB on Hibernate 7.4, how to read the root SQLException, and the fix for each cause.

Spring AI 1.x to 2.0 Migration Guide

Spring AI 2.0 migration guide: upgrade a Spring AI 1.x app to 2.0.1 step by step, with the build errors you will see and the fix for each one.

Spring Boot and Vaadin CRUD Example

Build a Spring Boot and Vaadin CRUD app with a Grid, a validated form and Spring Data JPA. Complete code for every file, run steps and real screenshots.

Spring Authorization Server Tutorial (Spring Boot 4)

Spring Authorization Server issues OAuth2 access tokens and OpenID Connect ID tokens from our own Spring Boot application. This tutorial builds an authorization server and a resource server on Spring Boot 4.1, with client_credentials and PKCE clients, key rotation, custom claims, JDBC client storage, MockMvc tests and real curl output.

Spring Boot 4 Tutorial: What’s New in 4.0 and 4.1 (Examples)

Spring Boot 4 is the major release built on Spring Framework 7, Jakarta EE 11 and Jackson 3, with Java 17 as the minimum. This tutorial builds one Spring Boot 4.1.1 app that shows the modular starters, JSpecify null-safety with NullAway, API versioning, HTTP service clients with @Retryable, Jackson 3, MockMvcTester and RestTestClient tests, virtual threads, OpenTelemetry traces and the 4.1 additions, and ends with an upgrade checklist from Spring Boot 3.5.

Spring Framework 7: What’s New, Features and Examples

Spring Framework 7 keeps Java 17 but moves to Jakarta EE 11, JSpecify null-safety and Jackson 3. This overview lists every notable change in a summary table and shows the main new features, such as @Retryable, API versioning and BeanRegistrar, with short examples.

Spring Security 7: What’s New and How to Migrate From 6.x

Spring Security 7 ships with Spring Boot 4 and removes the APIs deprecated in 6.x, such as and() chaining and AntPathRequestMatcher. This overview lists every change in one table, explains each one briefly with snippets for the main ones, and ends with a migration checklist from 6.x.

Java Interview Questions for 5 Years of Experience

30 Java interview questions for developers with about 5 years of experience, each with a direct answer, the reason behind it and a runnable Java 25 snippet. Covers collections internals, concurrency, Java 21 to 25 features, JVM memory and GC, streams, design, Spring @Transactional pitfalls and small system design tasks.

Kubernetes for Beginners: Hands-On Guide With Spring Boot

A hands-on Kubernetes guide for Java developers: deploy a Spring Boot API and PostgreSQL to a local kind cluster and learn pods, Deployments, Services, Ingress, ConfigMaps, Secrets, volumes and StatefulSets with real kubectl output.

Spring Boot: Import Excel File into Database (Apache POI)

Upload an .xlsx class roster to a Spring Boot endpoint, read it with Apache POI, validate every row with Bean Validation and save the valid rows in JDBC batches. Includes a JSON error report, duplicate checks, a SAX reader for large files with measured heap, upload limits and MockMvc tests.

Spring Boot Hibernate 7 Example with Spring Boot 4.1

Set up Hibernate 7.4 in a Spring Boot 4.1 application: the JPA starter, datasource and JPA properties, entities, Spring Data repositories, transactions, the Session API, SQL logging, tests on H2 and MySQL, and the Hibernate 7 upgrade changes.

Spring Boot Virtual Threads: Setup, Load Test and WebFlux

One property, spring.threads.virtual.enabled=true, moves Spring Boot requests, @Async methods and scheduled tasks to virtual threads. A weather API measured against platform threads and WebFlux, plus pinning and monitoring on Java 25.

[Solved] CommandAcceptanceException: Error executing DDL

1. Problem When writing tests that depend on H2 database in a Spring boot application, we may encounter the CommandAcceptanceException: Error executing DDL. The root cause exception will be org.h2.jdbc.JdbcSQLSyntaxErrorException in the logs. The exception stack trace will look something like this: If you are trying to run unit tests with the H2 database and … Read more

Spring Boot JpaRepository Example

Learn to Spring Data JPA module and work with JpaRepository interface for performing the CRUD operations in underlying databases in a Spring Boot application.

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.

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.

WebSecurityConfigurerAdapter Deprecated: Migration Guide

WebSecurityConfigurerAdapter was deprecated in Spring Security 5.7 and removed in 6.0. Replace it with a SecurityFilterChain bean, requestMatchers, a PasswordEncoder bean, WebSecurityCustomizer and @EnableMethodSecurity on Spring Boot 4, with tests.

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.

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.