Administrator

Lokesh Gupta

Lokesh Gupta is a Java developer with more than 20 years of experience and the founder of HowToDoInJava, which he started in 2012. He has worked on Java and Spring applications at Hewitt Associates, Hughes Systique, Adobe and Bank of America. The site has over 1,600 tutorials on Java, Spring Boot, Hibernate, testing and TypeScript. Every example is run and verified before it is published, and the source code is on GitHub.

Website: https://howtodoinjava.com

Github: https://github.com/lokeshgupta1981/

Twitter: @HowToDoInJAVA

LinkedIn: https://www.linkedin.com/in/lokeshgupta1981/

My Articles:

Java Interview Questions for 5 Years of Experience

30 Java interview questions for experienced developers, with direct answers and code examples covering collections, concurrency, JVM memory, streams, design, Spring transactions and small system design tasks.

Unsupported Class File Major Version 69: Fix for Java 25

“Unsupported class file major version 69” means a JVM or bytecode tool older than Java 25 tried to read a Java 25 class file. Learn to read the class file version, map it to the Java release, and fix the error by upgrading the runtime, compiling with –release, or upgrading Gradle, Spring, JaCoCo, Mockito and Lombok.

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.

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.

Java Random Number Generators in Multithreaded Code

A shared Random is thread-safe but makes every thread fight over one seed. Learn which generator each thread should use, how to keep seeded results reproducible, and what a JMH benchmark measured on Java 25.

How to Fix MySQL Innodb_Force_Recovery Not Working Issue?

The innodb_force_recovery option starts MySQL in a recovery mode that lets the InnoDB storage engine run on a corrupted database, so we can dump the data before we rebuild the damaged tables. When innodb_force_recovery is not working, the cause is either a problem in the option file or corruption that …

JPackage : Create MSI/EXE Installer for Java App

The jpackage is a command-line tool introduced in Java 14 and helps create native installable packages (.exe, .msi, .dmg, .pkg, .deb, .rpm) for Windows, macOS, and Linux. Jpackage bundles Java applications along with a Java runtime (JRE) image, ensuring that end users do not need to install Java separately.

How to Use DBCC CHECKDB to Check the Integrity Check in SQL DB

Database integrity refers to the accuracy, consistency, and reliability of the data stored within a database. It ensures that data remains uncorrupted, and adheres to defined rules. In SQL databases, integrity is supported through constraints like primary keys, foreign keys, unique constraints, and check constraints, alongside physical and logical data …

Logback.xml File Configuration Example

This short Logback tutorial lists examples for configuring logback.xml to log messages to both the console and/or file appenders. 1. Logback Dependencies To include Logback, include the latest version of logback-classic dependency, which transitively includes all the necessary dependencies, including SLF4J. Spring Boot comes with SLF4J and Logback as the …

[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 …

Log4j2 YAML File Example

Learn to configure log4j2.yaml file to output the log statements to the console, rolling files, etc. Also, learn to configure log4j2 appenders, levels, and patterns.

Spring Boot WebClient GET Example

Learn to make HTTP GET requests (sync and async) using Spring Boot WebClient, pass URI and query params, handle responses, and handle errors.

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.