How to use H2 DB in Core Java Project

How to use H2 DB in Core Java Project

Hey, Tea Lovers! Today let’s look at how you can use an in-memory database to test a core Java project, specifically H2 DB. The official name of H2 DB is H2 Database Engine. I will focus on it in the testing and not on the main project. I just want to give you a glimpse of how you can get started with it. I would highly recommend for the database logic or testing you shouldn’t rely upon In-Memory databases, always have Integration Test’s in this scenarios. Use this tool for a small or temporary test. ...

November 20, 2021 · 8 min · Imran Shaikh
How I Created Squid Game in Java RedGreen Light

How I Created Squid Game in Java: Red/Green Light

Hey Tea lovers! Before talking about Squid Game in Java, let me ask you What do you do on a bored Sunday afternoon? Go out, have fun, or do Netflix and Chill right? Well, I did Netflix and chill. Well, not chill, but experienced a rollercoaster of emotions with the sensational Korean Drama Squid Game on Netflix. Oh Boy! What a massive hit it is. One of the best series I have seen. It has all the things and the story is gripping. Oh sorry, I am off on a different tangent. I know it’s not a movie review blog, but I can’t help but be amazed. ...

October 23, 2021 · 8 min · Imran Shaikh
7 Must have IntelliJ IDEA Plugins in 2021 for Java Developers

7 Must have IntelliJ IDEA Plugins in 2021 for Java Developers

Hey, Tea Lovers! Let’s look at the 7 must-have IntelliJ Idea Plugins in 2021 for Java Developers. These plugins will help you skyrocket your productivity along with some fun elements. Every Java developer using IntelliJ IDEA must add these plugins right after installing Intellij. However, I also have another list focused on the same topic with different plugins. You can read them on Every Programmer Needs these IntelliJ IDEA Plugins. So let us jump right into it. but before that, prepare your cup of tea to sip and code. ...

August 13, 2021 · 4 min · Imran Shaikh
7 Best Ways You can Loop through Lists in Java

7 Best Ways You can Loop through Lists in Java

Hey, Tea Lovers! Let’s look at the 7 ways you can iterate or loop through a Java List. These are ordered from basic to advance to pro level. So let’s jump to see different types of loops in java I will use the same list throughout all the code samples. List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 6, 7, 8, 10); Basic Level of Loops First, let’s look at the basic level of looping. These are your for-loop, while-loop, and enhanced for-loop. Let’s take a look at them one by one. ...

August 10, 2021 · 5 min · Imran Shaikh
Convert Milliseconds to LocalDateTime in Java8 & Above

Convert Milliseconds to & from LocalDateTime in Java8 & Above

Hey, Tea lovers! This short post is about how you can easily convert the milliseconds to a LocalDateTime Object. This is a very short guide on how to create LocalDateTime via milliseconds. I will also show you the opposite, that is, converting LocalDateTime to milliseconds. Note that, if you want to convert it to LocalDate instead of LocalDateTime, the process is similar. Requirement for the Conversions Well, you will only require Java. Since LocalDateTime or LocalDate in java was introduced from Java 1.8, you will require Java 8 or higher. ...

July 31, 2021 · 3 min · Imran Shaikh
Singleton Pattern In Java One for All Hero (1) (1)

Singleton Pattern In Java: One for All Hero

Hey, Tea lovers! Today I will talk about the One for All power. Singleton Design Pattern in Java. This post will be the start of the series on Design Patterns in Java. The Singleton pattern is the most basic and easy-to-understand design pattern there is. So it makes a good starting point in the journey of design patterns. Let us jump right into it. What is Singleton Pattern and Object By definition, the singleton pattern is a design pattern that restricts the class to initiate only once. This means it can only make only one object of the class. And this pattern is a base pattern of other design patterns as well. Such as Factory Pattern, Builder Pattern, or Prototype Pattern. Don’t worry we will convert them in the upcoming post. So please subscribe to our website. ...

July 11, 2021 · 5 min · Imran Shaikh
Java-Base64-How-to-Encode-and-Decode-Base64-in-Java-1

Java Base64: How to Encode and Decode Base64 in Java

Hey, Tea Lovers! In this post, we will talk about Base64 in Java. Base64 is a very common and easy way to encode data. It helps us to at least make it hard to understand the data at first glance to keep it secure. In the Java Base64 library, we have unique types of Base64 techniques which you will see in a bit. For this, we will be using the inbuilt Java Base64 Encoder and Decoder. You don’t need any additional Base64 libraries to do this simple task. ...

May 21, 2021 · 6 min · Imran Shaikh
Java-Interface-and-Various-Types-of-Interfaces-1-1

Java Interface and Various Types of Interfaces

Hey, Tea lovers! before talking about Java Interface, Have you ever heard the phrase, “Man Of Many Faces”? if not, it means a person can be of everything or anything when it comes to portraying something. It can be one thing and a minute after another without losing its strength. Java’s interface fits perfectly with this title. It is an integral part of java and has become so powerful over the years, that it shifted the way a Java programmer thinks. It has added various ways of doing things in Java. Depending on the number of methods only, an interface’s definition as well as the object-creating process changes. ...

May 14, 2021 · 5 min · Imran Shaikh
How to Achieve Greatness in JDBC Performance

How to Achieve Greatness in JDBC Performance

Hey, tea lovers! Today, we will talk about the JDBC, the code which connects Java code to the realm of the databases, and the best practices of JDBC to achieve greatness in the performance of database operations. We will talk about the best practices as we talked about in “ What’s In A Name: Java Naming Conventions” but this time, it is about the JDBC best practices. These are the small tweaks you can do to your code that, not only makes it much faster but also makes your code less horrific. It will be like a list to improve the JDBC or we can say, handle the database like a pro. So let us start the adventure. ...

May 7, 2021 · 6 min · Imran Shaikh
Java 16 Record to Reduce Boilerplate Code of POJO

Java 16 Record to Reduce Boilerplate Code of POJO

Hey, Tea Lovers! Java 16 is released a few days back, well, a month to be precise. It introduced 17 new features. I discussed the 4 features that the developer will use a lot in my previous post, Simplified Java 16 Key Features. In this post, we will deep dive into Java 16 Record to see how it helps us to reduce the boilerplate code of POJO classes. POJO Boilerplate Code Whenever you need a simple class to hold the data, you write a POJO class, right? But Even though your need is simple, you need to write tonnes of code for just a few things. Such as getters and setters, constructors, toString, and equals and hashcode. No matter how many different POJOs you write, you have to write these 90% similar methods. These things with little to no changes that we have to write again and again for simple purposes are known as Boilerplate code. ...

May 1, 2021 · 9 min · Imran Shaikh