Welcome to my blog !

Static Import in java with examples| Difference between static vs normal import

September 27, 2022 ·  3 min read

Static Import in java 5 static import is a java language feature introduced in version 5 alias code name as tiger version. It was introduced to simplify the access of static variables and static members without using class names. Before static import is introduced, we have normal import statements for every java class to use the methods and classes with using the class name. Here is a normal import for List class example...

Statement,PreparedStatement and CallableStatement in java JDBC with examples

September 27, 2022 ·  3 min read

In JDBC, statements use to execute the SQL queries in databases. We can send the simple SQL, complex SQL, and PL/SQL queries using these statements. There are three types of Statements. Statement PreparedStatement CallableStatement a Connection object is required to create any statement object. Here is java code to create connection object Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con= DriverManager.getConnection("jdbc:odbc:orc", "scott", "tiger"); Statement in JDBC It is a simple Statement to execute SQL queries like insert, update, and delete operations....

Spring RestTemplate - consume paginated response API java

September 27, 2022 ·  3 min read

RestTemplate in spring used to consume REST API with simplifying the process. It includes HTTP connection handling and is integrated with Jackson binder to serialize and deserialize Java objects to/from json objects. It is easy to integrate external APIs in Java and Android codebases. This tutorial will not cover creating REST API in java. RESTtemplate consume plain json data Let’s assume that REST API returns the following json data. The following data returns an only array, but not pagination data....

Spring boot cors issue

September 27, 2022 ·  2 min read

These are short tutorials on how to count the number of instances/objects of a class in java. An object of a class is created using a new keyword in java. an object is an instance of a class. A class can have multiple objects. How do you count the number of objects/instances of a class in java? static is the global scope that can be created and accessed by all objects of a class....

Solutions for Frequently occurred exceptions in java language

September 27, 2022 ·  3 min read

Java Exception solutions Exception handling is a basic part of Java application development. It helps to make the application stable and error-free. When the application results error, java handles using exception classes. The Exception handle uses try, catch, and finally blocks. During development, Developers used to encounter different types of exceptions frequently. This post is about listing out the list of common exceptions, and solutions for fixing them. Following are the exceptions in a java programming language....

You'll get a notification every time a post gets published here.