The following article presents Best Practices for Writing Efficient JSP Code. The following list shows some best practices for writing efficient JSP (JavaServer Pages) code. List of Best Practices for Writing Efficient JSP Code Minimize scriptlets. Avoid using scriptlets (<% %>), which embed Java code directly into your JSP page. Instead, use JSTL (JSP Standard …
Wake Up to Better Performance with Hibernate
In this post on Wake Up to Better Performance with Hibernate, I will provide an introduction to Hibernate and its role in improving performance for Java applications. Introduction to Hibernate Basically, Hibernate is an Object Relational Mapping (ORM) framework for Java language. Further, it provides a mapping from Java classes to database tables and helps …
How to Perform Database Operations Using JSP?
The following article describes How to Perform Database Operations Using JSP. Here is an example code for a JSP program that displays, inserts, updates, and deletes data from a database table. Connect to the database. Display data from the database table. Insert data into the database table. Update data in the database table. Delete data …
A Brief Tutorial on Spring Framework
In this article on A Brief Tutorial on Spring Framework, I will explain Spring Framework, its benefits, and a simple example of an application using the Spring Framework. What is Spring? Basically, Spring is not a J2EE Framework. Instead, it is an open-source framework that supports the POJO (Plain Old Java Objects) based programming model. …
Find the Longest Sequence of Negative Numbers and Find its Sum in Java
In this article, I will discuss how to Find the Longest Sequence of Negative Numbers and Find its Sum in Java. The following code example shows the use of a nested loop to find the longest sequence of negative number. The problem is stated as follows: We have an array of integers containing both positive …
A Mini Project on JDBC Operation
In this article on A Mini Project on JDBC Operation, the use of HDBC API in Java is explained through an application. To begin with, create the table Exam. The following list provides the details of the columns in the exam table. user_id: varchar(100) password: varchar(100) user_type: varchar(100) incorrect_attempts: Number(2) lock_status: Number(2) user_name: varchar(100) The …
Understanding Map Collection in Java
This article on Understanding Map Collection in Java describes the java collection interface Map. Also, several examples are also included here. Map is one of the collection interfaces available in java.util package. In order to store key-value pairs, the Map interface is used. Also, the keys that the Map contains are unique. Some of the …
Examples of Sets in Java
This article demonstrates some Examples of Sets in Java. The Set Interface in Java Basically, it is an unordered collection and doesn’t allow duplicates. When you add a duplicate element, it will replace the existing one. TreeSet class implements the Set interface. It represents a sorted collection. When we need to store the user defined …
ArrayList Exercise in Java
The following ArrayList Exercise in Java will help you to work with the ArrayList collection class. Create an ArrayList in Java and add the days of the week. Also, display the ArrayList. Define a class Emp with the following fields – emp_id, name, salary, gender, department, and email_id. Also, define the corresponding constructors, and getter …
Logic Building Exercise in Java
The following Logic Building Exercise in Java will help you crack a coding round in a programming job selection process. Find whether a number is a palindrome or it can become a palindrome by adjusting a single digit. Write a program to find the cyclic sum of the digits of a number. How to find …