Representation of Integers at a Bit Level in Java
1. Overview Java stores numbers in memory as binary. Understanding how integers are represented at the bit level can help us with certain operations. In this tutorial, we’ll look at some of the...
View ArticleQuerydsl vs. JPA Criteria
1. Overview Querydsl and JPA Criteria are popular frameworks for constructing type-safe queries in Java. They both provide ways to express queries statically typed, making it easier to write efficient...
View ArticleDynamically Managing Kafka Listeners in Spring Boot
1. Overview In today’s event-driven architectures, managing data streams effectively is essential. Apache Kafka is a popular choice for this, but integrating it into our applications has its...
View ArticleChecking if a Date Object Equals Yesterday
1. Introduction When working with date and time data in Java applications, it’s often crucial to compare dates for various purposes, such as scheduling tasks, reminders, or reporting. One common...
View ArticleImplement Two-Level Cache With Spring
1. Overview Caching data means our applications don’t have to access a slower storage layer, thereby improving their performance and responsiveness. We can implement caching using any in-memory...
View ArticleCheck if a Given Time Lies Between Two Times Regardless of Date
1. Introduction In Java, there are numerous ways to determine if a particular time lies within the two times without considering dates. In this tutorial, we’ll look at several possible ways to achieve...
View ArticleGuide to ExecutorService vs. CompletableFuture
1. Introduction In this tutorial, we’ll explore two important Java classes for handling tasks that need to run concurrently: ExecutorService and CompletableFuture. We’ll learn their functionalities and...
View ArticleQuerying JSONB Columns Using Spring Data JPA
1. Introduction Spring Data JPA provides a powerful abstraction layer for interacting with relational databases. However, traditional relational tables might not be ideal for storing complex,...
View ArticleHow to Check Number Perfection
1. Introduction A perfect number is a special type of positive integer that holds a unique property as it is equal to the sum of its proper divisors, excluding the number itself. One of the most...
View ArticleChecking Which Java Version Is Running in Eclipse
1. Overview When working with Java in the Eclipse IDE, ensuring the correct Java version is essential for compiling and executing code accurately. Eclipse simplifies this process by providing...
View ArticleContinue With Transaction After Exception in JPA
1. Overview The transaction mechanism in JPA is a powerful tool that ensures atomicity and data integrity by either committing all changes or rolling them back in case of an exception. However, there...
View ArticleHow to Test Spring Application Events
1. Overview In this tutorial, we’ll discuss testing code that uses Spring application events. We’ll start by manually creating test utilities that help us publish and collect application events for...
View ArticleFix the PSQLException: “FATAL: sorry, too many clients already”
1. Overview In this tutorial, let’s discuss the PostgreSQL exception, FATAL: sorry, too many clients already. Generally, the PostgreSQL server throws this error when it cannot accept a connection...
View ArticleConvert a Phone Number in Words to Number with Java
1. Overview We may wish to process a telephone number expressed as text. Perhaps we have received a telephone number via a speech-to-text interface. In this tutorial, we’ll look at an algorithm for...
View ArticleThe Difference Between Throwing an Exception and Mono.error() in Spring Webflux
1. Overview Error handling is a critical aspect of reactive programming with Spring WebFlux. Developers usually rely on two primary methods for error handling: throwing exceptions or using the...
View ArticleIntroduction to Light-4J
1. Introduction Traditional frameworks, while robust, often introduced complexities that challenged agility. Modern development demands frameworks that aren’t just powerful but nimble. Lightweight...
View ArticleHow to Scale a Bufferedimage in Java?
1. Introduction In this tutorial, we’ll go over how to rescale an image using basic Java APIs. We’ll show how to load and save the image from/to a file and explain some technical aspects of the...
View ArticleJava Weekly, Issue 537
1. Spring and Java >> Expressive REST Resources with Java Records and Jakarta REST [blog.payara.fish] Java Records As DTOs: concise, immutable, readable, expressive, and more secure. Yeah....
View ArticleNew Features in Java 21
1. Overview Oracle released Java 21 on September 19, 2023. It’s the latest Java LTS release after Java 17. This article will discuss the new features and enhancements added to Java 21. 2. List of JEPs...
View ArticleSet Matrix Elements to Zero in Java
1. Overview Matrices are fundamental data structures used in various computer science, mathematics, and engineering fields. In some scenarios, we might need to set certain matrix elements to zero based...
View Article