Skip to content

Santhosh Ponnam

Technology Blog

  • Home
  • About
  • Technology
    • Java
    • ORM
  • Privacy Policy
  • Toggle search form
  • Another Log4j Bug – DoS Java
  • Setting Environment Variables in Windows Java
  • Consent Management – DPDP Spring Boot HikariCP Connection Pooling
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team Java
  • HikariCP Connection Pooling for Spring Boot for 1.x version Spring Boot
  • JPA vs Hibernate – Specification Vs Implementation ORM
  • Windows Commands – kill port number Installations and Configurations
  • Sonar Qube – Code Coverage and Code Quality Tool Installations and Configurations

Why to have a private constructor?

Posted on August 13, 2018September 1, 2021 By Santhosh Ponnam

In Java, it is possible to have a private constructor. When and why should we use private constructor is explained in detail below. Defining a constructor with the private modifier says that only the native class (as in the class in which the private constructor is defined) is allowed to create an instance of the…

Read More “Why to have a private constructor?” »

Java

hashCode and equals methods in java

Posted on November 2, 2016August 12, 2021 By Santhosh Ponnam

Usage of hashCode() and equals()hashCode() method returns integer for a given object. This integer is used for determining the bucket location, when this object needs to be stored in some HashTable like data structure. By default, Object’s hashCode() method returns an integer representation of memory address where object is stored. equals() method is used to…

Read More “hashCode and equals methods in java” »

Java

Unique Random ‘N’ digit Number generator

Posted on August 12, 2016August 13, 2021 By Santhosh Ponnam
package com.santhosh.random;

import java.util.Random;

import org.apache.commons.lang3.StringUtils;

public class SequenceGenerator {
    private final Random random;

    public SequenceGenerator() {
        random = new Random();
    }

    /**
     * Returns a pseudo-random integer between 0 and n-1.
     *
     * @see Random#nextInt(int)
     */
    public int nextInt(int n) {
        return random.nextInt(n);
    }

    public static void main(String[] args) {
        SequenceGenerator g = new SequenceGenerator();
        String result = StringUtils.leftPad(String.valueOf(g.nextInt(99999)),
                5, '0');
        System.out.println(result);
    }
}
Java

Setting Environment Variables in Windows

Posted on August 2, 2016August 12, 2021 By Santhosh Ponnam

Why do I need to set JAVA_HOME? Many Java based programs like Tomcat require JAVA_HOME to be set as environment variable to work correctly. Please note JAVA_HOME should point to a JDK directory not a JRE one. The point of setting the environment variable is to let programs know in which directory executables like javac can be…

Read More “Setting Environment Variables in Windows” »

Java

Posts pagination

Previous 1 2

Recent Posts

  • Consent Management – DPDP
  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling

Archives

  • June 2025
  • December 2021
  • August 2021
  • November 2020
  • March 2020
  • August 2018
  • November 2016
  • August 2016

Recent Posts

  • Consent Management – DPDP
  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling

Archives

  • June 2025
  • December 2021
  • August 2021
  • November 2020
  • March 2020
  • August 2018
  • November 2016
  • August 2016




Recent Posts

  • Consent Management – DPDP
  • Another Log4j Bug – DoS
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team
  • Fixing Log4j Vulnerability
  • Log4J (RCE) Vulnerability

Categories

  • Installations and Configurations
  • Java
  • ORM
  • Spring Boot
  • Spring Boot HikariCP Connection Pooling
  • Unique Random ‘N’ digit Number generator Java
  • HikariCP Configurations – Database Connection Pooling Installations and Configurations
  • Log4j Vulnerability / Version Upgrade to 2.16.0 by Apache Team Java
  • Another Log4j Bug – DoS Java
  • Windows Commands – kill port number Installations and Configurations
  • HikariCP Connection Pooling for Spring Boot for 1.x version Spring Boot
  • Setting Environment Variables in Windows Java
  • JPA vs Hibernate – Specification Vs Implementation ORM

Copyright © 2025 Santhosh Ponnam.

Powered by PressBook News WordPress theme