Erp Important Questions For Viva
Erp Important Questions For Viva
JSP is a server-side technology that allows embedding Java code in HTML. It differs from
Servlets by enabling easier creation of dynamic content using HTML-like syntax.
JSP directives provide instructions to the JSP container and include page, include, and
taglib.
Exceptions in JSP can be handled using the errorPage and isErrorPage attributes or through
custom error pages.
Java Servlets
A Servlet is a Java program that handles HTTP requests and responses on a web server,
generating dynamic content.
7. Explain the Servlet lifecycle.
doGet() handles HTTP GET requests (less secure, limited data), while doPost() handles
HTTP POST requests (more secure, no data size limits).
Session management can be handled using cookies, URL rewriting, HttpSession, or hidden
form fields.
A Servlet Filter is used to intercept requests and responses, often for tasks like logging,
authentication, and data compression.
JDBC is an API that allows Java applications to interact with databases using SQL queries.
The four types are: Type-1 (JDBC-ODBC Bridge), Type-2 (Native API), Type-3 (Network
Protocol), and Type-4 (Thin Driver).
13. What are the main steps to connect a Java application to a database using JDBC?
Steps include loading the driver, establishing a connection, creating a statement, executing
queries, and closing the connection.
14. What is the purpose of the PreparedStatement and how does it differ from
Statement?
15. What are transactions in JDBC and how do you manage them?
Transactions ensure data integrity by grouping multiple operations; they are managed using
commit() and rollback() methods.
Hibernate
16. What is Hibernate and what are its advantages over JDBC?
18. What is HQL (Hibernate Query Language) and how is it different from SQL?
HQL is a query language similar to SQL but works with Hibernate objects and properties,
not directly with database tables.
The types include Table per Class, Table per Subclass, and Table per Concrete Class.
20. How does Hibernate manage caching and what are the types of caching it supports?
Hibernate uses two levels of caching: First-level (default session cache) and Second-level
(shared cache). It also supports query caching.
Spring
1. What is the Spring Framework, and what are its key features?
Spring is a Java framework for building enterprise applications with features like
dependency injection, AOP, and data access.
Dependency injection is a design pattern where the framework manages the dependencies
between objects automatically.
They are specialized annotations for different layers: @Component (generic), @Service
(business logic), @Repository (data access), @Controller (web controller).
Spring Boot
6. What is Spring Boot and how does it differ from the traditional Spring Framework?
Spring Boot simplifies application development by providing default configurations and an
embedded server.
7. What are Spring Boot starters, and how do they simplify the development process?
Starters are pre-configured dependencies that simplify adding functionalities like web,
data access, or security to a Spring Boot project.
These files are used to configure application settings like database connection details,
server port, and other properties.
10. What is the role of the embedded server in Spring Boot, and which servers are
commonly used?
The embedded server allows applications to run without needing external server setup.
Common servers are Tomcat, Jetty, and Undertow.