Categories
Java

In-Memory Local Cache Option for Java

In Java, an in-memory cache can be implemented using ConcurrentMap very efficiently, but it has only the problem that objects can not be evicted automatically after a certain time or limit, we need to remove entries manually. In many situations, the in-memory cache can be very useful to increase speed, but obviously, it will also […]

Categories
Java

Java Disable HTTPS Certificate Validation

While working with HTTP clients in java, many times we get a certificate validation exception as given below. Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target The above exception can be caused due to a self-signed certificate or expired certificate as the client is unable to […]

Categories
Java

How to Write MySql Junit Tests?

MySql is the most used open-source RDBMS in the world with different application development stacks. As nowadays most of the development of the system is TDD based, so for writing test cases for the MySql database will require running DB or we can use H2 database with MySql mode or we can even use Embedded […]

Categories
Java

Postgres JDBC and Hibernate Using JSONB Type

While working with Postgres JSONB type and Java, if we assign the value of type UUID as a string then we will get the following exception. To assigning value incorrect way is given below, if you are using PreparedStatement. First, in the query, you need to write input param par as given below for the […]

Categories
Java

Postgres JDBC and Hibernate Using UUID Types

While working with Postgres UUID type and Java, if we assign the value of type UUID as a string then we will get the following exception. To assigning value incorrect way is given below, if you are using PreparedStatement. If the value of UUID is a string type, then first you need to convert it […]

Categories
Java

How to write Java Postgres JDBC JUnit Test

Postgres is one of the leading open-source RDBMS for developing applications using Java. As now development involves more and more TDD, we need to write Junit tests that can run independently on any build environment without the dependency on any required Database engine. For the Postgres database, I found one very handy Java lib that […]

Categories
Java

How to validate UUID String in Java

Many times we are supposed to get a string and that should be a valid UUID or GUID. Unfortunately Java UUID class don’t provide any function to validate whether a string is valid UUID or not. In many places, you will see to use the UUID java class function fromString, if any exception then the […]

Categories
Article

Install and Configure Postgres on Ubuntu 20, VirtualBox, and Windows

In this post, I will write complete steps to install and configure Postgres RDS on Ubuntu 20 running on a VirtualBox over Windows 10 host. Installing Postgres on Ubuntu 20 For easiness connect Ubuntu instance using Putty windows client. Now you can easily copy and paste commons on the putty console. Steps to install Postgres […]

Categories
How To

Telnet Client Installation on Windows 10

Telnet client on windows is one utility that enabled telnet protocol. This utility has been used to check TCP bidirectional connections between TCP servers. We generally use it to test listening port is reachable or not from one client. By default, it is not installed on Windows 10. You can install this very easily by […]

Categories
Article

Change Default GIT Author and Committer in Eclipse GIT Plugin

While working in Eclipse IDE and GIT plug-in for Eclipse, Author and Commiter filed is set by default to PC name and current user as displayed in pic given below. But in most cases, we want to do commits with our Git user and email id, You can set author and committer while committing. But […]