Skip to main content

Posts

Showing posts from 2019

Using varargs(Variable -length argument) in Java

Sometimes you might want to write a method that takes a variable number of arguments. In Java, there is a feature called variable-length arguments, or varargs for short, which allows you to do this. Prior to JDK 5, variable-length arguments could be handled in two ways, using overloading using array argument. syntax for varargs public static String format(String pattern, Object... arguments); The three periods after the final parameter's type indicate that the final argument may be passed as an array or as a sequence of arguments.  Varargs can be used only in the final argument position There can be only one variable argument in a method. Vararg Methods can also be overloaded but overloading may lead to ambiguity. Example:  public class Varargs { public static void main(String[] args) { printItems(1,2, "mango", "apple", "orange"); printItems(2,1, "book", "pen", &

What is L1, L2 and L3 Support Engineering

In this blog article, I'm going to explain about the Software support engineering role with my experience. I was a Level 2 and 3 support Engineer during my career. L1 - Level 1 L2 - Level 2 L3 - Level 3 Ticket - Incident L1 support includes interacting with customers, understand their issue and create tickets against it. The ticket then routed to the relevant L2 support ( Integration support, Server & Storage support, etc ...). L1 support Engineers have basic knowledge of product/service and skill to troubleshoot a very basic issue like password reset, software installation/uninstallation/reinstallation. L2 support manages the tickets which routed to them by L1( L2 support also can create tickets against any issue notice by them). They have more knowledge, more experience in solving related complex issues and can guide/help L1 support folks job in troubleshooting. If the solution not provided at this level then escalate to the L3. L3 is the last line of support

Many to Many mapping in Spring boot

In this blog, I will explain how to use many-to-many mapping in Spring boot Application What you need? JAVA MySql Eclipse IDE ( whatever you like IDE, I'm using Eclipse for this example) Maven ( you can use the Gradle as well) Initial Plan spring boot application will be created using spring initializer web tool and imported as a maven project to the eclipse ide. Scenarios will be post and tags. one post have more than one tags and one tags have more than one posts. Two model classes will be created for Post and Tags. Finally, the command line runner interface will be used to run the application. Below diagram is the database model diagram which we going to install using the spring boot application. Let's Start to Code. You need to configure the application.properties file for database connections. add the following content to the src/main/resources/application.properties spring.datasource.url=jdbc:mysql://localhost:3306/learning spring.dataso

One to Many Mapping using Spring boot

In this blog, I will explain how to use one-to-many mapping in Spring boot Application What you need? JAVA MySql Eclipse IDE ( whatever you like IDE, I'm using Eclipse for this example) Maven ( you can use the Gradle as well) Initial Plan I will create a spring boot application project using the  Spring Initializer  web tool and import the project as a maven project. after configuring the all necessary setting, I will code for one-to-many mapping. Below diagram is the database model diagram which we going to install using the spring boot application. Let's Start to Code. You need to configure the application.properties file for database connections. add the following content to the src/main/resources/application.properties spring.datasource.url=jdbc:mysql://localhost:3306/learning spring.datasource.username=root spring.datasource.password=root spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect spring.jpa.hibernate

One to One Mapping with Spring boot

In this blog, I will explain how to use one-to-one mapping in Spring boot Application What you need? JAVA MySql Eclipse IDE ( whatever you like IDE, I'm using Eclipse for this example) Maven ( you can use the Gradle as well) Initial Plan I will create a spring boot application project using the Spring Initializer web tool and import the project as a maven project. after configuring the all necessary setting, I will code for one-to-one mapping. Below diagram is the database model diagram which we going to install using the spring boot application. Let's Start to Code. You need to configure the application.properties file for database connections. add the following content to the src/main/resources/application.properties spring.datasource.url=jdbc:mysql://localhost:3306/learning spring.datasource.username=root spring.datasource.password=root spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect spring.jpa.hibern

Run Spring boot application on Docker

In this blog, I will explain how to  run the .jar file on Docker Engine Docker  containers are the fastest growing cloud-enabling technology and driving a new era of computing and application architecture with their lightweight approach to bundle applications and dependencies into isolated, yet highly portable application packages. What you need? Docker running on your computer. Initial Plan I will create a simple spring boot application and then create a Dockerfile to build the docker image. finally, I will run the application on Docker container If you don't have Docker running on your computer. Here is the link to install the Docker   Step 1: Create Spring-boot application Navigate this link to create the initial spring-boot application. Import the project to the Eclipse IDE or whatever you like and create the simple rest endpoint. Here is my code. import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.a

How to ssh to the remote server using Windows machine

In this blog, I will explain how to use the putty and puttygen software to connect to the remote server. putty is a free software application for  Window. which can be used to make a connection to the remote server. What you need  ssh login credential download putty.exe and puttygen.exe from this link  Initial Plan I have created an AWS EC2 instance and downloaded the myKeys.pem file. By using the puttygen software, myKeys.pem will be converted to myKeys.ppk format. Finally, using this key I will make a connection to the remote server using putty. Let's Start. Step 1: convert .pem to  .ppk  Start the puttygen application. Click on Load and select the .pem file to be converted. click on the "Save Private Key" button and name the key with .ppk extension and save. Now I have the myKeys.ppk file. I will use this key to connect to the remote server. Step 2: make a connection with the remote server Start the putty applic

Run Website on AWS EC2

You may need to learn how to run your website without any help from others. Here is a way to do this. What you need. AWS Account ( you can register for Free Tier account) Initial Plan Firstly, I will create an AWS S3 Bucket for uploading the web content. In order to copy the content of the S3 to EC2, I need to create IAM role with s3 full access permission. Then  I will launch an AWS EC2 instance and configure the EC2 instance to run my website. This is very simple. Let's Start. Steps 1: Create S3 bucket Go to services and select the S3 Create a bucket Now click the create button I have downloaded the basic HTML template website for this blog. you can simply upload your web content to the S3 bucket. Here I have a zip file. click the newly created bucket and select the web content to upload Click the upload button Ok, now we have our web content on the S3 bucket. Let's create an IAM role w