Quantcast
Channel: Baeldung
Browsing all 3605 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Java IndexOutOfBoundsException “Source Does Not Fit in Dest”

1. Overview In Java, making a copy of a List can sometimes produce an IndexOutOfBoundsException: “Source does not fit in dest”. In this short tutorial, we're going to look at why we get this error when...

View Article


Image may be NSFW.
Clik here to view.

Localizing Exception Messages in Java

1. Overview Exceptions in Java are used to signal that something has gone wrong in a program. In addition to throwing the exception, we can even add a message to provide additional information. In this...

View Article


Image may be NSFW.
Clik here to view.

Ignoring Fields With the JPA @Transient Annotation

1. Introduction When persisting Java objects into database records using an Object-Relational Mapping (ORM) framework, we often want to ignore certain fields. If the framework is compliant with the...

View Article

Image may be NSFW.
Clik here to view.

Sealed Classes and Interfaces in Java 15

1. Overview The release of Java SE 15 introduces sealed classes (JEP 360) as a preview feature. This feature is about enabling more fine-grained inheritance control in Java. Sealing allows classes and...

View Article

Image may be NSFW.
Clik here to view.

Creating a Discord Bot with Discord4J + Spring Boot

1. Overview Discord4J is an open-source Java library that can primarily be used to quickly access the Discord Bot API. It heavily integrates with Project Reactor to provide a completely non-blocking...

View Article


Image may be NSFW.
Clik here to view.

Accessing Spring Boot Logs in Docker

1. Overview In this tutorial, we'll explain how to access Spring Boot logs in Docker, from local development to sustainable multi-container solutions. 2. Basic Console Output To begin with, let's build...

View Article

Image may be NSFW.
Clik here to view.

Setting Memory And CPU Limits In Docker

1. Overview There are many cases in which we need to limit the usage of resources on the docker host machine. In this tutorial, we'll learn how to set the memory and CPU limit for docker containers. 2....

View Article

Image may be NSFW.
Clik here to view.

JPA CascadeType.REMOVE vs orphanRemoval

1. Overview In this tutorial, we'll be discussing the difference between two of the options we have for removing entities from our databases when working with JPA. First, we'll start with...

View Article


Image may be NSFW.
Clik here to view.

Java Weekly, Issue 359

1. Spring and Java >> R2DBC joins Reactive Foundation [r2dbc.io] A good day for open standards: Reactive Relational Database Connectivity (R2DBC) joins the Reactive Foundation! >> The...

View Article


Image may be NSFW.
Clik here to view.

DispatcherServlet and web.xml in Spring Boot

1. Overview The DispatcherServlet is the front controller in Spring web applications. It's used to create web applications and REST services in Spring MVC. In a traditional Spring web application, this...

View Article

Image may be NSFW.
Clik here to view.

Maven Packaging Types

1. Overview The packaging type is an important aspect of any Maven project. It specifies the type of artifact the project produces. Generally, a build produces a jar, war, pom, or other executable....

View Article

Image may be NSFW.
Clik here to view.

Defining Indexes in JPA

1. Introduction In this tutorial, we'll discuss defining indexes using JPA's @Index annotation. Through examples, we'll learn how to define our first index using JPA and Hibernate. After that, we're...

View Article

Image may be NSFW.
Clik here to view.

Testing Kafka and Spring Boot

1. Overview Apache Kafka is a powerful, distributed, fault-tolerant stream processing system. In a previous tutorial, we learned how to work with Spring and Kafka. In this tutorial, we'll build on the...

View Article


Image may be NSFW.
Clik here to view.

Reusing Docker Layers with Spring Boot

1. Introduction Docker is the de facto standard for creating self-contained applications. From version 2.3.0, Spring Boot includes several enhancements to help us create efficient Docker Images. Thus,...

View Article

Image may be NSFW.
Clik here to view.

Creating a Generic Array in Java

1. Introduction We may wish to use arrays as part of classes or functions that support generics. Due to the way Java handles generics, this can be difficult. In this tutorial, we'll understand the...

View Article


Image may be NSFW.
Clik here to view.

Explanation of ClassCastException in Java

1. Overview In this short tutorial, we'll focus on ClassCastException, a common Java exception. ClassCastException is an unchecked exception that signals the code has attempted to cast a reference to a...

View Article

Image may be NSFW.
Clik here to view.

Performance Difference Between save() and saveAll() in Spring Data

1. Overview In this quick tutorial, we'll learn about the performance difference between save() and saveAll() methods in Spring Data. 2. Application In order to test the performance, we'll need a...

View Article


Image may be NSFW.
Clik here to view.

The Capacity of an ArrayList vs the Size of an Array in Java

1. Overview Java allows us to create arrays of fixed size or use collection classes to do a similar job. In this tutorial, we're going to look at the difference between the capacity of an ArrayList and...

View Article

Image may be NSFW.
Clik here to view.

Java Weekly, Issue 360

1. Spring and Java >> From Spring Boot to Quarkus [blog.frankel.ch] The new kid on the block: a practical guide on how to migrate a typical Spring Boot app to Quarkus! >> New language...

View Article

Image may be NSFW.
Clik here to view.

What’s New in Java 15

1. Introduction Java 15 reached general availability in September 2020 and is the next short-term release for the JDK platform. It builds on several features from earlier releases and also provides...

View Article
Browsing all 3605 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>