Java Naming Conventions

Java Naming Conventions: What's In a Name?

Hey, Tea Lovers! Today we will talk about the java naming conventions, according to the best practices. Imagine a world without names. What would happen if nothing in this world had a name? This article would have been a very different story. Oh sorry, we wouldn’t even be able to tell the story. What about if we had weird names? Then what will aliens think about us, that we are a bunch of idiots with weird names? So, everything is in the name, especially when it comes to programming languages. So it is important to focus on naming conventions. ...

April 24, 2021 · 7 min · Imran Shaikh
The magic of reflection API

Java Reflection API: The Magical World of Java

Hey, tea lovers! Ever wonder how Spring auto-wires the fields without using setters or constructors or Hibernate stores column values to the appropriate fields? or Gson converts your POJO to JSON? How are they reading the class’s field? and not only reading but changing or storing the values in them, even though they are private? Let me reveal the mystery. They are using Java Reflection API. What kind of magical substance is this? How these libraries are using them? How can we use them? Phew! too many questions to answer. Let’s just dive into it and find the answers. ...

April 18, 2021 · 8 min · Imran Shaikh
Thread Pool in Java Threads Explained

Thread Pool in Java Multi-Threading Explained

Hey, Tea Lovers! Today we will talk about the Thread Pool in Java. And how it saves resources and increases performance. And also, why we should use a thread pool in Java if we are building a multi-threaded java application? Threads in Java Before we talk about the thread pool in Java, let’s revisit threads. Threads are simple yet powerful things. By creating multiple threads, and multithreading applications, you can do tasks simultaneously. Wow, how cool and how efficient, right? But wait, if there is a heaven there is a hell. ...

April 17, 2021 · 10 min · Imran Shaikh
Java 16 is Here and Key Takeaways for Java Developers

Java 16 is Here! New Features of Java 16 Simplified

Hey, Tea Lovers! Today I will briefly talk about the latest release of Java 16 on March 16, 2021. I will talk about the key takeaway from the features and improvements, which I think will affect the day-to-day life of a Java developer. This post is heavily based on the press release “Oracle Announces Java 16”. If you want to see it in more detail, you can check out the press release here. ...

April 4, 2021 · 6 min · Imran Shaikh
How to Install Latest Java and Set JAVA_HOME on Ubuntu

How to Install Latest Java and Set JAVA_HOME on Ubuntu

Hey, Tea lovers! In this post, we will have a look at how we can easily install the latest Java or JDK on the Ubuntu system. It will be a very quick and small post. Before You Start I will be installing Open JDK, and I will show the installation for JDK 8, JDK 11, and JDK 14 on Ubuntu. For the Windows user, I have already written a post on " Install Latest or Any Java Version in 3 Simple Steps: Windows". ...

March 1, 2021 · 4 min · Imran Shaikh
How to Select Specific Folders or Files As Input in Flink

How to Select Specific Folders or Files As Input in Flink

Hey, tea lovers! Today I will show you how to specifically select the desired folders or files in Flink Batch Job programmatically. We will discuss when given a root path you can decide which file or folder to read in Flink Batch Job. And why suddenly do I pick up this topic you say? Well, I was working on such a task myself where I needed to read the S3 files which are under folders with dates. Those date folders are in a rolling fashion like , 2021_01_13_1, 2021_01_13_2, 2021_01_13_3 and so on. And in these folders, there were multiple files, so based on the given date I needed to read all those files which are in the given date folder (the folder name should contain the date obviously). ...

February 20, 2021 · 7 min · Imran Shaikh
How to Create a Multi-Database Pool in HikariCP

How to create a Multi-Database Pool in HikariCP

Hey, Tea lovers! Today we will go over a hack/way to create a multi-database pool in HikariCP. It is a continuation of the post " JDBC Connection Pooling Explained with HikariCP", where we talked about connection pooling and how we can create it using hikariCP. This post is not an explanation post, but rather shows one of the ways I used to create a common Class to access different connection pools of various databases. It is my solution from experience and not a standard approach. However, you are free to use the code as it is very generic and can be used right away. ...

December 3, 2020 · 9 min · Imran Shaikh
how to use batch in jdbc

How to Use Batch in JDBC to Insert huge data

Hey. Tea Lovers! Today we will discuss batching and how to use batch in JDBC to insert huge data. Before jumping in, I would suggest you look at my previous posts, " How to Achieve Greatness in JDBC Performance" and " JDBC Connection Pooling Explained with HikariCP". This will help you to further increase the performance along with reliability, maintainability, and flexibility. Why use Batch Insertion Many of you have worked on some projects where you needed to insert a large amount of data into the database. I prefer just using plain JDBC for this kind of job to give the operation a significant boost. But inserting the record one by one as we do is a very slow process. We need to wait until the data of a single record goes to the database, insert happens and then over the network, an acknowledgment occurs, phew! Luckily in JDBC, we have batch operations. With this, we can insert the data in batches rather than one by one, giving a huge advantage. ...

November 30, 2020 · 7 min · Imran Shaikh
Interview Question- IS-A & HAS-A Relationship

Interview Question: IS-A & HAS-A Relationship

Hey, Tea Lovers! Today let’s look at the most asked interview question, IS-A.)& HAS-A relationship. Both beginners and experienced people get this question in their interviews. This post is one of the many in the series of Interview Questions, where we don’t just hang you with one line answer, but rather try to explain it so that it gets fits into your head. I know you are in a hurry to prepare for the interview, so I will make this post as short as possible, So prepare your cup of tea to sip and code. ...

November 29, 2020 · 5 min · Mahesh More
Most Loved Interview Question _ Comparator vs Comparable

Interview Question: Comparable vs Comparator

Hey, Tea Lovers! Today let’s look at the most asked interview question, Comparable vs Comparator. Both beginners and experienced people get this question in their interviews. This post is one of the many in the series of Interview Questions, where we don’t just hang you with one line answer, but rather try to explain it so that it gets fits into your head. I know you are in a hurry to prepare for the interview, so I will make this post as short as possible, So prepare your cup of tea to sip and code. ...

November 14, 2020 · 11 min · Mahesh More