Best Practices for Sizing the JDBC Connection Pool
1. Introduction In this tutorial, we’ll discuss the best strategies for sizing the JDBC connection pool. 2. What Is a JDBC Connection Pool, and Why Is It Used? A JDBC connection pool is a mechanism...
View ArticleRemoving ROLE_ Prefix in Spring Security
1. Overview Sometimes, when configuring application security, our user details might not include the ROLE_ prefix that Spring Security expects. As a result, we encounter “Forbidden” authorization...
View ArticleJava Enums With All HTTP Status Codes
1. Introduction Enums provide a powerful way to define a set of named constants in the Java programming language. These are useful for representing fixed sets of related values, such as HTTP status...
View ArticleNumber Formatting in Java
1. Overview In this tutorial, we’ll learn about the different approaches to number formatting in Java, and how to implement them. 2. Basic Number Formatting With String#format The String#format method...
View ArticleBuild a Conversational AI With Apache Camel, LangChain4j, and WhatsApp
1. Overview In this tutorial, we’ll see how to integrate Apache Camel and LangChain4j into a Spring Boot application to handle AI-driven conversations over WhatsApp, using a local installation of...
View ArticleJava Weekly, Issue 554
1. Spring and Java >> Spring Boot 3.3 Boosts Performance, Security, and Observability [infoq.com] It is always cool to see just how much Boot is improving from version to version. Lots of...
View ArticleGuide to Choosing Between Protocol Buffers and JSON
1. Overview Protocol Buffers (Protobuf) and JSON are popular data serialization formats but differ significantly in readability, performance, efficiency, and size. In this tutorial, we’ll compare these...
View ArticleHow to Convert to and From a Stream and Two Dimensional Array in Java
1. Overview Working with arrays and streams is a common task in Java, particularly when dealing with complex data structures. While 1D arrays and streams are straightforward, converting between 2D...
View ArticleHow to Read Text Inside Mail Body
1. Introduction In this tutorial, we’ll explore how to read text inside the body of an email using Java. We’ll use the JavaMail API to connect to an email server, retrieve emails, and read the text...
View ArticleDifference Between null and Empty Array in Java
1. Overview In this tutorial, we’ll explore the difference between null and empty arrays in Java. While they might sound similar, null and empty arrays have distinct behaviors and uses crucial for...
View ArticleIntroduction to MyBatis-Plus
1. Introduction MyBatis is a popular open-source persistence framework that provides alternatives to JDBC and Hibernate. In this article, we’ll discuss an extension over MyBatis called MyBatis-Plus,...
View ArticleCalculate the Sum of Diagonal Values in a 2d Java Array
1. Overview Working with two-dimensional arrays (2D arrays) is common in Java, especially for tasks that involve matrix operations. One such task is calculating the sum of the diagonal values in a 2D...
View ArticleCreate a ChatGPT Like Chatbot With Ollama and Spring AI
1. Introduction In this tutorial, we’ll build a simple help desk Agent API using Spring AI and the llama3 Ollama. 2. What Are Spring AI and Ollama? Spring AI is the most recent module added to the...
View ArticleAvoiding “no runnable methods” Error in JUnit
1. Overview JUnit is the primary choice for unit testing in Java. During the test execution, developers often face a strange error that says there are no runnable methods even when we’ve imported the...
View ArticleHow to convert List to Flux in Project Reactor
1. Overview In Reactive Programming, it’s often necessary to transform Collections into a reactive stream known as a Flux. This becomes a crucial step when integrating an existing data structure into...
View ArticleIntroduction to Armeria
1. Introduction In this article, we’ll look at Armeria – a flexible framework for efficiently building microservices. We’ll see what it is, what we can do with it, and how to use it. At its simplest,...
View ArticleHow to Fill an Array With Random Numbers
1. Overview Generating random numbers is a common programming task primarily used in simulation, testing, and games. In this tutorial, we’ll cover multiple ways of filling the content of an array with...
View ArticleAutomated End-to-End Testing With Playwright
1. Overview End-to-end testing is one of the important factors in determining the overall working of the software product. It helps uncover the issues that may have gone unnoticed in the unit and...
View ArticleCollect Successive Pairs From a Stream in Java
1. Overview In Java Streams, processing and transforming data efficiently is crucial for effective programming. Two powerful techniques for handling successive elements are using SimpleEntry for...
View ArticlePrint an Array Without Brackets and Commas
1. Introduction When printing an Array, the default print format will print the values in brackets, with commas separating each element. In this tutorial, we’ll learn how to print an Array without...
View Article