What is N+1 SELECT Problem in Hibernate? Strategies to avoid this?
Java Revisited
by javin paul
1w ago
In some cases while using Hibernate for object-relational mapping, you will encounter the N+ 1 select problem. That is, Hibernate will execute (n+1) queries to populate a list of records of size n, I mean 5 SELECT queries will be required to populate 4 records. This happens when each object contains reference of another object which needs to be populated. For example, suppose you have list of authors and you want to print out title of books written by each other. A naive ORM will first do a SELECT query to load all authors and then execute another N SELECT query to load book for each auth ..read more
Visit website
Top 22 Apache Tomcat Interview Questions Answers for Java JEE Developers
Java Revisited
by javin paul
1w ago
The Apache Tomcat is one of the most popular web server used to deploy Java web application comprising HTML, JavaScript, Servlet and JSP. If you have ever worked in a Java web application you might have found yourself using Tomcat everywhere, from test environment to production. It is the defacto standard for deploying Java Web applications without EJB because using application server like WebSphere or WebLogic is both costly and superfluous for such web application. As a Java developer, working in Java and Spring based web applications, you should know some basic and advanced detail of Tomcat ..read more
Visit website
Top 10 HTTP Status Code Every RESTful web Service Developer Should know
Java Revisited
by javin paul
2w ago
A good knowledge of HTTP protocol is must for a RESTful Web Service developer because REST uses HTTP principles and a good portion of its popularity is due to HTTP itself. One of the important part of HTTP is the status code, which gives useful information related to client request. They are also known as HTTP response code because they are sent in header on HTTP response by Server to indicate what happened with client's request. The status codes ranges from 100 to 500 but not all of them are valid and useful. Instead the first number e.g. 1xx or 2xxx denotes the class of status codes.  J ..read more
Visit website
10 Example of Gson in Java - JSON tutorial
Java Revisited
by javin paul
2w ago
The Gson library is a gift from Google to Java developers. It provides the simplest but powerful mechanism to deal with JSON documents in Java. By using Gson library, you can parse JSON String to generate Java objects, serialize a Java object to create a JSON document. You can even pretty print JSON String by setting some option to the Gson class, which is the main helper class to interact with Gson library. It also provides mechanism to deal with nulls e.g. you can include null on JSON String or you can omit them. By default Gson print JSON in compact format where null fields are not exported ..read more
Visit website
Difference between Servlet and Filter in Java
Java Revisited
by javin paul
3w ago
Servlet and Filter are two of the essential concepts defined in Servlet specification. They are core of any web application because most of the request will pass through them. This is why they are also very popular on Java Web developer interviews. What is the difference between a Servlet and a Filter is one of the most common and interesting interview question related to Servlet. If you can explain the difference clearly, you improve your chance of hiring a lot. In order to understand and explain the difference, you must understand what is the purpose of Servlet and Filter, How they work and ..read more
Visit website
Top 27 Gson JSON Parsing Interview Questions with Answers in Java
Java Revisited
by javin paul
3w ago
Hello guys, parsing and creating JSON is a very common task in any Java application, particularly spring based application and that's why its important for a Java developer to not just understand the JSON format but also to be familiar with the important JSON parsing libraries in Java like Gson and Jackson. It's not just important for your day to day Java development work but also for interviews as there is a increased focus on checking if candidate is familiar with key JSON libraries like Jackson or Gson or not. Since I shared Java interview questions on core Java topics like concurrency, abs ..read more
Visit website
Difference between known_hosts and authorized_keys file in SSH - Linux
Java Revisited
by javin paul
3w ago
If you have used SSH to login into remote host in Linux, you might have come across these two files stored under the .ssh directory in your home directory e.g. ~/.ssh. Both files are used in the login process for authentication, but the main difference between known_hosts and authorized_keys files are that, known_host is used for server authentication, while authorized_keys are used for client or user authentication. SSH allows login using both password and private keys, you might have heard about trusted SSH connection between two host to download files without entering password, this is achi ..read more
Visit website
What is the ContextLoaderListener in Spring MVC? What does it do?
Java Revisited
by javin paul
1M ago
The ContextLoaderListener is one of the important component of Spring MVC framework. It is like any listener defined by Servlet specification and specified in web.xml using <listener> tag. It is loaded when Spring MVC based web application is deployed in any Servlet container e.g. Tomcat. The ContextLoaderLister of Spring MVC is responsible for loading root ApplicationContext for Spring. The application context is the place where Spring bean lives. If you need reference to a Spring bean either its auto-wired or injected by framework or you can get it directly from application context. In ..read more
Visit website
Difference between List of ? (any type) and List of Object in Java Generics
Java Revisited
by javin paul
2M ago
No doubt that Generics is one of the most confusing topics in Java and you can easily forget concepts and rules, especially, if you don't code Java everyday. For example, both List<?> and List<Object> looks similar but there is a subtle difference between them, the List<?> is basically a list of any type, you can assign a list of String i.e. List<String> or list of Integer i.e. List<Integer> to it. You see the point, it uses the unbounded wildcard <?>, which means any type. It provides it the much needed Polymorphism require while writing Generic methods. Ba ..read more
Visit website
10 Examples of Java Regular Expression Special or Meta Characters
Java Revisited
by javin paul
2M ago
Hello guys, If you want to learn regular expression better in Java, you must remember meaning of all the special characters. They are the one, which makes a regular expression complex, but if you know and understand them then you can easily understand at least 50% of regular expression you encountered in Java applications. They are also known as reserved characters. In a regular expression, a character denotes itself unless it is one of the special character. For example, regular expression "a" will match letter "a" and return true, if input is "a" and false otherwise, but "a*" will not match ..read more
Visit website

Follow Java Revisited on FeedSpot

Continue with Google
Continue with Apple
OR