Unit 1 (2024)
Unit 1 (2024)
Shweta Singh
Assistant Professor
CSE-AI
Evaluation Scheme
JSP: Introduction, Overview, JSP Scriptlet Tag, JSP expression Tag, JSP
declaration Tag, Life Cycle of JSP, JSP API, Implicit Objects: JSP
request, JSP response, JSP config, JSP session, JSP Application, JSP
PageContext; JSP Page, JSP Exception.
Spring 5.0: Spring Core Introduction and Overview, Managing Beans, The
Spring Container, The Factory Pattern, Dependency Injection (DI), Spring
Managed Bean Lifecycle, Constructor Injection, Metadata/Configuration:
Life Cycle Annotations, Java Configuration, XML Free configuration.
Spring Boot: Spring Boot Starters, CLI, Application Class, Logging, Auto
Configuration Classes, Spring Boot dependencies, Spring data JPA introduction and
Overview
Text books:
4.Katy Sierra and Bert Bates, “Head First: Java”, O’Really, 2008
5.Katy Sierra and Bert Bates, “Head First: Servlets & JSP”, O’Really , 2008
•
To design and develop the dynamic web sites using, Servlet and jsp.
•
To understand the concept of business logic to develop the enterprises application
by Spring framework.
•
To apply the MVC design pattern in developing a live project.
•
To learn the concept of database handling in java and apply this concept in
transactional processing based project.
Analyze and design the Spring Core Modules and DI to configure and wire beans (application K4,K5
CO3
objects) together
Design Model View Controller architecture and ready components that can be used to develop K2, K3, K6
CO4
flexible and loosely coupled web applications.
CO5 Deploy JPA to Map, store, retrieve, and update data from java objects to relational databases and K5
vice versa.
1. Engineering knowledge:
2. Problem analysis:
3. Design/development of solutions:
4. Conduct investigations of complex problems:
5. Modern tool usage:
6. The engineer and society:
7. Environment and sustainability:
8. Ethics:
9. Individual and team work:
10. Communication:
11. Project management and finance:
Shweta Singh ACSAI0612 Advance
05/14/2024
12. Life-long learning 11
Java Programming Unit 1
CO-PO Mapping
Mapping of Course Outcomes and Program Outcomes:
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
ACSE 3 3 2 3 3 3 2 3 3 3 2 3
0601.1
ACSE 3 2 3 2 3 2 2 2 3 3 3 3
0601.2
ACSE 3 3 3 2 3 3 2 3 3 3 2 3
0601.3
ACSE 3 3 3 2 3 3 2 3 3 3 3 3
0601.4
ACSE 3 3 3 2 3 2 2 3 3 3 3 3
0601.5
Averag 3 2.8 2.8 2.2 3 2.6 2 2.8 3 3 2.6 3
Shweta Singh ACSAI0612 Advance
05/14/2024 12
Java Programming Unit 1
e
Program Specific Outcomes
ACSE0601.1 3 3 2 3
ACSE0601.2 3 3 3 2
ACSE0601.3 3 3 2 2
ACSE0601.4 3 2 3 2
ACSE0601.5 3 2 2 2
PEO3: able to inculcate professional and social ethics, team work and leadership
for serving the society.
PEO4: able to inculcate lifelong learning in the field of computing for successful
career in organizations and R&D sectors.
Shweta Singh ACSAI0612 Advance
05/14/2024 15
Java Programming Unit 1
End Semester Question Paper Template
Prerequisites:
•
Having knowledge about core java concepts.
•
Basic knowledge abut the JDBC concepts.
•
Basic knowledge about the business logic.
•
Basic knowledge about MVC design pattern
•
Advance Java Programming provides libraries to understand the concept of Client-Server architecture for web-
based applications.
•
We can also work with web and application servers such as Apache Tomcat and Glassfish Using these servers,
we can understand the working of HTTP protocol.
•
It provides a set of services, API and protocols, that provides the functionality which is necessary for
developing multi-tiered application, web-based application.
•
There is a number of advance Java frameworks like, Spring, Hibernate, Struts, that enables us to develop
secure transaction-based web applications such as banking application, inventory management application.
•
https://youtu.be/96xF9phMsWA
•
https://youtu.be/Zopo5C79m2k
JDBC: Introduction
JDBC Driver
DB Connectivity
Servlet Interface, Generic Servlet and HTTP Servlet with Servlet Life Cycle
Objective of Unit 1:
To understand the concepts of JDBC(Java Database Connectivity) driver
To understand the use of various types of SQL command in JDBC connectivity.
To understand the concepts of Statement and PreparedStatement interface
To learn the concepts of stored procedure creation in JDBC.
To understand the concepts of Generic Servlet and HTTP Servlet
To understand the concepts of Redirecting the HTTP request
To understand the concepts of session and event handling.
Reference : https://www.google.com/url?sa=i&url=https%3A%2F%2Fptop.only.wip.la%3A443%2Fhttps%2Fwww.infoworld.com%2Farticle%2F3388036%2Fwhat-is-jdbc-introduction-to-java-database-
connectivity.html&psig=AOvVaw1pj_8eVXEcI75Z8ZGaLVAg&ust=1705997928122000&source=images&cd=vfe&opi=89978449&ved=2ahUKEwiazpvVx_CDAxWHcWwGHd2dDGgQr4kDegQIARBS
JDBC API
29
JDBC Drivers (Type I: JDBC-ODBC Bridge Driver)
Type I driver provides mapping between JDBC and access API of a database
The access API calls the native API of the database to establish communication
ODBC API
Native API
Database
API
Client Specific Protocol
I)
Protocol
Application Database
JDBC Open Database Connectivity (ODBC)
ODBC Interface
•
A standard database access method developed by the SQL
Access group in 1992.
• The goal of ODBC is to make it possible to access any data
from any application, regardless of which database
management system (DBMS) is handling the data.
• ODBC manages this by inserting a middle layer, called a
database driver , between an application and the DBMS.
• The purpose of this layer is to translate the application's
data queries into commands that the DBMS understands.
• For this to work, both the application and the DBMS must
be ODBC-compliant, that is, the application must be
capable of issuing ODBC commands and the DBMS must
be capable of responding to them.
JDBC
Drivers (Type II: Native Driver)
•
Type II driver communicates directly with native API
• Type II makes calls directly to the native API calls
• More efficient since there is one less layer to contend with (i.e. no ODBC)
• It is dependent on the existence of a native API for a database
Native API
Client
Application Database
API Database
Protocol Specific Protocol
JDBC Drivers (Type III: Network Protocol Driver)
•
Type III driver make calls to a middleware component running on another server
• This communication uses a database independent net protocol
• Middleware server then makes calls to the database using database-specific protocol
• The program sends JDBC call through the JDBC driver to the middle tier
• Middle-tier may use Type I or II JDBC driver to communicate with the database.
Driver (Type
III)
Client Middlewar
Application Net Protocol e Server Database Database
Specific Protocol
JDBC Drivers (Type III: Network Protocol Driver)
•
Type III driver make calls to a middleware component running on another server
• This communication uses a database independent net protocol
• Middleware server then makes calls to the database using database-specific protocol
• The program sends JDBC call through the JDBC driver to the middle tier
• Middle-tier may use Type I or II JDBC driver to communicate with the database.
Driver (Type
III)
Client Middlewar
Application Net Protocol e Server Database Database
Specific Protocol
JDBC Drivers (Type III: Network Protocol Driver)
•
Type III driver make calls to a middleware component running on another server
• This communication uses a database independent net protocol
• Middleware server then makes calls to the database using database-specific protocol
• The program sends JDBC call through the JDBC driver to the middle tier
• Middle-tier may use Type I or II JDBC driver to communicate with the database.
Driver (Type
III)
Client Middlewar
Application Net Protocol e Server Database Database
Specific Protocol
Drivers (Type IV : Thin Driver or Oracle Driver)
•
Type IV driver is an all-Java driver that is also called a thin driver
• It issues requests directly to the database using its native protocol
• It can be used directly on platform with a JVM
• Most efficient since requests only go through one layer
• Simplest to deploy since no additional libraries or middle-ware
Driver (Type
IV)
Client
Application Database Specific Database
Protocol
What we need to Perform JDBC Connection?
Requirements of JDBC Connection:
3 Database:
1 JDK:
A database is an organized collection of structured
The JDK is the development platform information, or data, typically stored electronically in a
for building Java applications. Install computer system. A database is usually controlled by a
a JDK in your development database management system (DBMS).
environment and use it to compile a
Java program. Oracle 11g /MySql
Driver
Established
Link to DB
Database
Steps to Connect Java Application with Database
Below are the steps that explains how to connect to Database in Java:
Class.forName("oracle.jdbc.driver.OracleDriver");
Create the connection object
To Create the connection Object we need to use the Connection Interface &
The getConnection() method of DriverManager class is used to establish connection with the database.
Connection con
=DriverManager.getConnection(“jdbc:Oracle:thin:@localhost:1521:xe”,”Username”,”Password”);
Create the Statement object
The createStatement() method of Connection interface is used to create statement.
The object of statement is responsible to execute queries with the database.
How to use
Statement stmt=con.createStatement();
Execute the query
The executeQuery() method of Statement interface is used to execute queries to the database.
This method returns the object of ResultSet that can be used to get all the records of a table.
while(rs.next())
{
System.out.println(rs.getInt(1)+" "+rs.getString(2));
}
Close the connection object
By closing connection object statement and ResultSet will be closed automatically. The close() method of
Connection interface is used to close the connection.
con.close();
Java Database Connectivity with Oracle
To connect java application with the oracle database, we need to follow 5 following steps.
So we need to know following information for the oracle database:
Driver class: The driver class for the oracle database is oracle.jdbc.driver.OracleDriver.
AP driver
API database server IP address
Service name
Connection URL: The connection URL for the oracle10G database is jdbc:oracle:thin:@localhost:1521:xe
Password: It is the password given by the user at the time of installing the oracle database.
Statement interface
The Statement interface provides methods to execute queries with the database. The statement interface is a factory of
ResultSet i.e. it provides factory method to get the object of ResultSet.
1) public ResultSet executeQuery(String sql): is used to execute SELECT query. It returns the object of
ResultSet.
2) public int executeUpdate(String sql): is used to execute specified query, it may be create, drop, insert, update,
delete etc.
3) public boolean execute(String sql): is used to execute queries that may return multiple results.
4) public int[] executeBatch(): is used to execute batch of commands.
ResultSet interface
The object of ResultSet maintains a cursor pointing to a row of a table.
Methods of ResultSet interface
1) public boolean next(): is used to move the cursor to the one row next from the current
position.
2) public boolean previous(): is used to move the cursor to the one row previous from the
current position.
3) public boolean first(): is used to move the cursor to the first row in result set object.
4) public boolean last(): is used to move the cursor to the last row in result set object.
5) public boolean absolute(int row): is used to move the cursor to the specified row number in the
ResultSet object.
6) public boolean relative(int row): is used to move the cursor to the relative row number in the
ResultSet object, it may be positive or negative.
7) public int getInt(int columnIndex): is used to return the data of specified column index of the current
row as int.
8) public int getInt(String columnName): is used to return the data of specified column name of the current
row as int.
9) public String getString(int columnIndex): is used to return the data of specified column index of the current
row as String.
10) public String getString(String columnName): is used to return the data of specified column name of the current
PreparedStatement interface
The PreparedStatement interface is a subinterface of Statement. It is used to execute parameterized query.
Eg:
(?) for the values. Its value will be set by calling the setter methods of PreparedStatement.
• Improves performance: The performance of the application will be faster if you use PreparedStatement
interface because query is compiled only once.
• The prepareStatement() method of Connection interface is used to return the object of PreparedStatement.
Syntax:
public PreparedStatement prepareStatement(String query)throws SQLException{}
Methods of PreparedStatement interface
Method Description
public void setInt(int paramIndex, int value) sets the integer value to the given parameter index.
public void setString(int paramIndex, String value) sets the String value to the given parameter index.
public void setFloat(int paramIndex, float value) sets the float value to the given parameter index.
public void setDouble(int paramIndex, double value) sets the double value to the given parameter index.
public int executeUpdate() executes the query. It is used for create, drop, insert, update,
delete etc.
public ResultSet executeQuery() executes the select query. It returns an instance of ResultSet.
Pseodu code:
int i=stmt.executeUpdate();
System.out.println(i+" records updated");
ResultSetMetaData Interface
• metadata means data about data i.e. we can get further information from the data.
• ResultSetMetaData interface is useful because it provides methods to get metadata from the ResultSet object.
Methods of ResultSetMetaData
Method Description
public int getColumnCount()throws SQLException it returns the total number of columns in the ResultSet
object.
public String getColumnName(int index)throws it returns the column name of the specified column
SQLException index.
public String getColumnTypeName(int index)throws it returns the column type name for the specified index.
SQLException
public String getTableName(int index)throws it returns the table name for the specified column index.
SQLException
ResultSetMetaData…………
The getMetaData() method of ResultSet interface returns the object of ResultSetMetaData.
Syntax:
public ResultSetMetaData getMetaData()throws SQLException
To add or import a jar files in your Eclipse
IDE
Try it yourself with steps on the right:
Servlet technology is used to create a web application (resides at server side and generates
a dynamic web page).
Servlets are the Java programs that run on the Java-enabled web server or application
server. They are used to handle the request obtained from the web server, process the
request, produce the response, and then send a response back to the web server.
Servlets are capable of handling complex requests obtained from the web server.
•
Servlet is an API that provides many interfaces and classes including documentation.
Servlet is a class that extends the capabilities of the servers and responds to the incoming
•
Servlet is a web component that is deployed on the server to create a dynamic web page.
•
Servlet Overview………..
Instantiate servlet
Servlet
Call init ( ) method Perform
HTTP Request 1 Initialization
Allocate request to thread Call service ( ) method
HTTP Request 2
Allocate request to thread Call service ( ) method Perform Service
Shutdown
Initiated
Block all further requests Wait for
HTTP Response active threads to end Perform Service
1
Terminate thread pool
Javax.servlet package can be extended for use with any application layer
protocol
http is the most popularly used protocol
Javax.servlet.http package is extension of the javax.servlet package for http
protocol
The Servlet spec allows you to implement separate Java methods implementing each HTTP
method in your subclass of HttpServlet.
Override the doGet() and/or doPost() method to provide normal servlet functionality.
Override doPut() or doDelete() if you want to implement these methods.
There's no need to override doOptions() or doTrace().
The superclass handles the HEAD method all on its own.
Javax.servlet Package
Contains 12 interfaces
7 interfaces implemented by the package
5 interfaces implemented by the user
Servlet Interfaces
RequestDispatcher SingleThreadModel
FilterChain Filter
FilterConfig
Servlet Classes
Methods
LifeCycle Methods
init()
service()
destroy()
Environment Methods
getServletContext()
getInitParameter(…)
getInitParameterNames()
javax.servlet.http
Service() method
Signature: Protected void service(HttpServletRequest req, HttpServletResponse res)
Forwards the request to the appropriate method
Developer should not normally override this method
Extends ServletRequest
Inherited methods from ServletRequest
getParameterNames()
getParameter(String name)
getParameterValues(String name)
getServerName()
getServerPort()
getRequestDispatcher
Extends ServletResponse
Inherited methods from ServletResponse
getoutputStream()
getWriter(String name)
flushBuffer()
setContentType()
New methods
encodeURL(String url)
encodeRedirectURL(String url)
setDateHeader()
setStatus()
Writing a Servlet
Create a servletclass
extend HttpServlet
import javax.servlet.http.*;
import java.io.*;
public class Login extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
{
// Get the parameter from the request
String username = request.getParameter("username");
// Send the response back to the user
try {
response.setContentType("text/html");
PrintWriter writer = response.getWriter();
writer.println("<html><body>");
writer.println("Thank you, " + username + ". You are now logged into the system.");
writer.println("</body></html>");
writer.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Example 1
Login.html
73
Example 1
web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Login Servlet</display-name>
<servlet>
<servlet-name>Login</servlet-name>
<servlet-class>niet.servlets.Login</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/Login</url-pattern>
</servlet-mapping>
</web-app>
74Shweta
Singh
Example 1
Login Deployment
•
Compiling
• Makefile contains all the scripts for compiling and deployment of the servlet
• Needs to be modified for any give application
•
Commands
• make shutdown: shuts down the tomcat server
• make clean: cleans up the current setup for the application
• make all: compiles code, creates war file and deploys war file on server
• make startup: starts the server again
•
Running the servlet
• http://localhost:8080/login/login.html
SendRedirect in servlet
The sendRedirect() method of HttpServletResponse interface can be used to redirect response to another resource, it
may be servlet, jsp or html file.
It works at client side because it uses the url bar of the browser to make another request. So, it can work inside and
outside the server.
Syntax of sendRedirect() method
Eg:
response.sendRedirect("http://www.niet.co.in");
Difference between forward() and
sendRedirect() method
• Each time user requests to the server, server treats the request as the new request
• A cookie is a small piece of information that is persisted between the multiple client requests.
• The cookie class provides an easy way for servlet to read, create, and manipulate HTTP-
style cookies, which allows servlets to store small amount of data.
<cookie.html>
<html>
<body>
<center>
<h1>Cookies Example in Java</h1>
<form action=“"http://localhost:8080/cookies/co” method="Post">
First name: <input type="text" name="fname">
Last name: <input type="text" name="lname">
<input type="submit“ value="SUBMIT">
</form>
</center> </body> </html
Cookies Example(cont..)
<AddCookie.java>
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class AddCookie extends HttpServlet
{
public void doPost(HttpServletRequest req,HttpServletResponse res) throws
ServletException,IOException
{
<AddCookie.java>(cont..)
String fname=req.getParameter("fname");
String lname=req.getParameter("lname");
res.sendRedirect("http://localhost:8080/cookies/st”);
}
}
<GetCookie.java>
import javax.servlet.*; out.println("<h1>");
import javax.servlet.http.*; Cookie[] c=req.getCookies();
import java.io.*; for(Cookie k:c)
public class GetCookie extends HttpServlet {
{ out.println(k.getValue());
public void doGet(HttpServletRequest }
req,HttpServletResponse res) throws out.println("</h1>");
ServletException,IOException }
{ }
PrintWriter out=res.getWriter();
84
Example of Session Tracking using HTTPSession interface
<Index.html>
<form action="servlet1">
Name:<input type="text" name="userName"/><br/>
<input type="submit" value="go"/>
</form>
<FirstServlet.java>
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class FirstServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResp
onse response){
try{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String s1=request.getParameter("userName");
out.print("Welcome "+s1);
<FirstServlet.java>
HttpSession session=request.getSession();
session.setAttribute(“First",s1);
out.print("<a href='servlet2'>visit</a>");
out.close();
}catch(Exception e){System.out.println(e);}
}
}
<SecondServlet.java>
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SecondServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServle
tResponse response)
try{
PrintWriter out = response.getWriter();
HttpSession session=request.getSession(false);
<SecondServlet.java>
String n=(String)session.getAttribute(“First");
out.print("Hello "+n);
out.close();
}catch(Exception e){System.out.println(e);}
}
ServletRequestEvent
ServletContextEvent
ServletRequestAttributeEvent
ServletContextAttributeEvent
HttpSessionEvent
HttpSessionBindingEvent
ServletRequestListener
ServletRequestAttributeListener
ServletContextListener
ServletContextAttributeListener
HttpSessionListener
HttpSessionAttributeListener
HttpSessionBindingListener
HttpSessionActivationListener
Shweta Singh ACSAI0612 Advance
92
Java Programming Unit 1
ServletContextEvent and ServletContextListener
index.html
MyListener.java
import javax.servlet.*;
import java.sql.*;
}catch(Exception e){e.printStackTrace();}
}
response.setContentType("text/html");
PrintWriter out = response.getWriter();
try{
//Retrieving connection object from ServletContext object
ServletContext ctx=getServletContext();
Connection con=(Connection)ctx.getAttribute("mycon");
ResultSet rs=ps.executeQuery();
while(rs.next()){
out.print("<br>"+rs.getString(1)+" "+rs.getString(2));
}
con.close();
}catch(Exception e){e.printStackTrace();}
out.close();
}
}
• The previous topic was mainly focused on the concepts of Java Servlet API and its life cycle.
• It was also focused on servlet event and listener classes with its implementation
A. Security
B. Transaction Management
C. Both A & B
D. None of the above
A. Entity Bean
B. Session Bean
C. Both A & B
D. None of the above
•What is javax.servlet.http.HttpServlet?
A - interface
B - abstract class
C - concreate class
D - None of the above.
A - request.getSession()
B - response.getSession()
C - new Session()
D - None of the above.
A - Header.getHeaderName(headerName)
B - response.getHeader(headerName)()
C - request.getHeader(headerName)
D - None of the above.
• Which of the following code retrieves the fully qualified name of the client making this
request?
A - request.getRemoteHost()
B - response.getRemoteHost()
C - Header.getRemoteHost()
D - None of the above.
•Which of the following code can be used to send an error response to the client using the
specified status code and clearing the buffer.
A - request.sendError(statusCode)
B - response.sendError(statusCode)
C - header.sendError(statusCode)
D - None of the above.
A - request.getSession()
B - response.getSession()
C - new Session()
D - None of the above.
A - session.getSessionId()
B - session.getId()
C - session.getActiveId()
D - None of the above.
•In CGI based application for every request server create a child
process
i) True
ii) False
https://www.youtube.com/watch?v=utANrHfAh28
https://www.digimat.in/nptel/courses/video/106105191/L01.html
https://www.youtube.com/watch?v=y_YxwyYRJek
https://www.youtube.com/watch?v=0SFVFe6a
https://www.youtube.com/watch?v=ajhWv31oN1k KK8
https://www.youtube.com/watch?v=v5vLuCBv8vg
https://www.youtube.com/watch?v=5ammL5KU4mo
a. True
b. False
2. The ACID properties does not describes the transaction management well.
a.True
b. False
3. The ResultSet.next method is used to move to the next row of the ResultSet, making
it the current row.
a. True
b. False
4. How many steps are used to connect any java application using JDBC?
a. 5
b. 4
c. 3
d. 6
6. Which models do the JDBC API support for the database access?
a. Two-tier models
b. Three-tier models
c. Both A & B
d. None of the above
a. 3
b. 4
c. 2
d. 5
a. 3
b. 2
c. 4
d. 5
10. Which services are provided to EJB components by the EJB container?
a. Transaction support
b. Persistence support
c. Naming support
d. All mentioned above
11. Which session bean maintain their state between client invocations but are not
required to maintain their state across server crashes or shutdowns?
a. Stateful Session Bean
b. Stateless Session Bean
c. Singleton Session Bean
d. None of the above
a.Statement
b.PreparedStatement
c.CallableStatment
d. CalledStatement
8. Which method is used to send the same request and response objects to another
servlet in RequestDispacher ?
a. forward()
b. sendRedirect()
c. Both A & B
d. None of the above
a. javax.servlet
b. javax.servlet.http
c. Both A & B
d. None of the above
Shweta Singh ACSAI0612 Advance
116
Java Programming Unit 1
Unit 1 MCQ s(cont..)
10. Which HTTP Request method is non-idempotent
a. GET
b. POST
c. BOTH A & B
d. None of the above
a. ServletConfig
b. ServletContext
c. Both A & B
d. None of the above
a. PUT
b. OPTIONS
c. DELETE
d. TRACE
13. Which one of the following scopes does the attribute in servlet is an object that can be set,
get or removed?
a. session scope
b. request scope
c. application scope
d. All mentioned above
Discuss about the life cycle of servlet and jsp with their
implementationShweta Singh ACSAI0612 Advance
129
Java Programming Unit 1
Thank You