Getting the Insert ID in JDBC
1. Introduction When working with JDBC to insert data into a database, retrieving the auto-generated primary key is a common requirement. JDBC provides a mechanism to fetch the insert ID immediately...
View ArticleNaming Executor Service Threads and Thread Pool in Java
1. Overview ExecutorService provides a convenient way to manage threads and execute concurrent tasks in Java. When working with ExecutorService, assigning meaningful names to threads and thread pools...
View ArticleConsumer Acknowledgments and Publisher Confirms with RabbitMQ
1. Overview In this tutorial, we’ll learn how to ensure message publication to a RabbitMQ broker with publisher confirmations. Then, we’ll see how to tell the broker we successfully consumed a message...
View ArticleIncompatibleClassChangeError in Java
1. Overview In this article, we’ll explore the IncompatibleClassChangeError in Java, a runtime error that occurs when the JVM detects a class change that is incompatible with the previously loaded...
View ArticleCounting an Occurrence in an Array
1. Overview A common programming problem is counting the occurrences or frequencies of distinct elements in a list. It can be helpful, for example, when we want to know the highest or lowest occurrence...
View ArticleTesting Quarkus With Citrus
1. Overview Quarkus, the Supersonic Subatomic Java, promises to deliver small artifacts, extremely fast boot time, and lower time-to-first-request. We can understand it as a framework that integrates...
View ArticleBlazing Fast Serialization Using Apache Fury
1. Overview In this article, we’ll learn about Apache Fury, an incubating project under the Apache Software Foundation. This library promises blazing-fast performance, robust capabilities, and...
View ArticleCheck if a List Contains Elements With Certain Properties in Hamcrest
1. Overview When writing unit tests in Java, particularly with the JUnit framework, we often need to verify that elements within a list have specific properties. Hamcrest, a widely used Matcher...
View ArticleHow to Handle Default Values in Avro
1. Introduction In this tutorial, we’ll explore the Apache Avro data serialization/deserialization framework. What’s more, we’ll learn how to approach schema definition with default values used when we...
View ArticleUpload Files With GraphQL in Java
1. Introduction GraphQL has transformed the way developers interact with APIs, offering a streamlined, powerful alternative to traditional REST approaches. However, handling file uploads with GraphQL...
View ArticleTestcontainers JDBC Support
1. Overview In this short article, we’ll learn about the Testcontainers JDBC support, and we’ll compare two different ways of spinning up Docker containers in our tests. Initially, we’ll manage the...
View ArticleUsing Amazon Athena With Spring Boot to Query S3 Data
1. Overview We often store large amounts of data in Amazon S3, but analyzing this data can be challenging. Traditional methods require us to move the data or set up complex systems like a data...
View ArticleJava IDEs in 2024 – Survey Results
I recently ran a short survey to understand what IDEs are the most popular for Java development in 2024. First, thank you to everyone who participated. Now, let’s look at the results: As we can see,...
View ArticleBuilding Simple Java Applications with Scala-CLI
1. Introduction We can independently create and run a simple Java class with just a Java installation. However, including third-party dependencies usually requires a build tool like Maven or Gradle,...
View ArticleDo Spring Prototype Beans Need to Be Destroyed Manually?
1. Introduction In this tutorial, we’ll explore how the Spring Framework handles prototype beans and manages their lifecycle. Understanding how to use beans and their scopes is an important and useful...
View ArticleGuide to FileOutputStream vs. FileChannel
1. Introduction When working with file I/O operations in Java, FileOutputStream and FileChannel are the two common approaches for writing data to files. In this tutorial, we’ll explore their...
View ArticleHow to Solve “java.lang.IllegalStateException:...
1. Introduction In this article, we’ll see a common mistake that developers make while using Spring Webflux. Spring Webflux is a non-blocking web framework built from the ground up to take advantage of...
View ArticleFunction Calling in Java and Spring AI Using the Mistral AI API
1. Overview Using large language models, we can retrieve a lot of useful information. We can learn many new facts about anything and get answers based on existing data on the internet. We can ask them...
View ArticleA Guide to the @AutoClose Extension in JUnit5
1. Overview In this brief tutorial, we’ll explore the new @AutoClose JUnit 5 annotation, which helps us deal with classes that require a specific method call after test execution. After that, we’ll...
View ArticleMaven Spotless Plugin for Java
1. Overview In this tutorial, we’ll explore the Maven Spotless Plugin, and use it to enforce a consistent code style across the project. Initially, we’ll use a minimal configuration to analyze the...
View Article