Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

 

and many more ....

 

 

Java 8 Compare Dates Example

1. Introduction Java 8 added a new set of packages to provide a comprehensive date-time model. Java 8 Date-Time API is a JSR-310 implementation.                   There are several interfaces: ChronoLocalDate, ChronoLocalDateTime, ChronoZonedDateTime in java.time.chrono packages. They all have isBefore, isAfter, isEquals, and compareTo methods to compare two dates. Java 8 date classes: ...

Read More »

Hibernate Optimistic Locking Example

In hibernate, Locking represents a mechanism to safeguard the records that can be simultaneously accessed to avoid the concurrency errors (i.e. when multiple users simultaneously update the records resulting in inconsistencies). Hibernate has two types of locking mechanisms i.e. Optimistic locking Pessimistic locking In this tutorial, we will explore the optimistic locking mechanism in the hibernate framework. 1. Introduction Object-Relational ...

Read More »

Hibernate Calling Stored Procedure Example

Stored Procedures are a set of compiled SQL statements residing in the database. In hibernate; there are three different approaches to call a stored procedure i.e. Query interface – createSQLQuery(. . . .); StoredProcedureQuery interface – createStoredProcedureQuery(. . . .); @NamedNativeQuery annotation In this tutorial, we will explore how to create a simple stored procedure in the MySQL database and ...

Read More »

Selenium Docker Example

This article is about using Selenium grid to automate testing efforts. This covers using selenium inside a Docker container to speed up the testing setup and easier administration. 1. Introduction 1.1 Selenium Grid Selenium is used to automate browsers. Selenium WebDriver has found its place in test automation for web applications. It is used to create robust, browser-based regression automation ...

Read More »

Hibernate DateTime Mapping Example

In hibernate; @Temporal annotation is used to store java.sql.Time, java.sql.Date or java.sql.Timestamp in the database. In this tutorial, we will explore how to work with Timestamp using the xml and annotation configurations in the Hibernate framework. 1. Introduction Object-Relational Mapping or ORM is the programming technique to map application domain model objects to the relational database tables Hibernate is a ...

Read More »

Git Abort Merge Example

In this post, we present a Git Abort Merge Example. 1. Introduction Merging branches is an important operation when working with Version Control Systems (VCSs). One feature that makes Git standout among other VCSs is its branching mechanism. The mechanism used by Git to create and manage branches is both lightweight and efficient in comparison to other VCSs. Because branching ...

Read More »

Java Factory Method Design Pattern Example

1. Introduction In this article we will discuss one of Java’s most common design patterns – Factory Method Design Pattern. This type of design pattern is a type of creational design pattern but it is one of the finest ways to generate an object. So, in Factory Method design pattern, we develop objects but without revealing the logic or functionality of creation ...

Read More »

Java 8 Stream Collectors groupingBy Example

1. Introduction SQL GROUP BY is a very useful aggregation function. It groups database records on certain criteria. Java 8 Stream API enables developers to process collections of data in a declarative way. Java 8 Collectors class provides a static groupingBy method: to group objects by some property and store the results in a Map instance. It has three signatures, which ...

Read More »

Git Add Submodule Example

In this post, we feature a comprehensive Example on Git Add Submodule. 1. Introduction An important concept in software development is reusability. When working on a software project you may have situations where a function or method is used in many places of an application. Rather than interspersing the function/method code throughout the application, it is useful to place it ...

Read More »

How to use WireMock for Mocking

In this article we will learn about WireMock for mocking. WireMock is a simulator for HTTP-based APIs. Some might consider it a service virtualization tool or a mock server. It enables you to stay productive when an API you depend on doesn’t exist or isn’t complete. It supports testing of edge cases and failure modes that the real API won’t reliably produce. ...

Read More »