Professional Documents
Culture Documents
Java
Unit 1
Objectives
Understanding Java EE
Java EE Architecture, Server and
Containers
Introduction to Java Servlets
Servlet API and Lifecycle
Working With Servlets
Working with Databases
Understanding Java EE
Security Technologies
Java EE Evolution
Java Platform, Enterprise Edition (Java EE), formerly Java 2 Platforms, Enterprise
Edition (J2EE), currently Jakarta EE, is a set of specifications, extending Java SE
with specifications for enterprise features such as distributed computing and
web services.
GlassFish Server
Two-Tier Architecture:
Three-Tier Architecture:
Multi-Tier Architecture:
EJB container
Web container
Application client container
Applet container
The Need for
DYNAMIC CONTENT
java.lang.Object
|_extended byjavax.servlet.GenericServlet
|_extended byjavax.servlet.http.HttpServlet
HTTP Servlet
Http Servlet must extend javax.servlet.http.HttpServlet class, which is an
abstract class
doGet() – This method is called by servlet service method to handle the HTTP
GET request from client. The Get method is used for getting information from
the server
doPost() – Used for posting information to the Server
doPut() – This method is similar to doPost method but unlike doPost method
where we send information to the server, this method sends file to the server,
this is similar to the FTP operation from client to server
doDelete() – allows a client to delete a document, webpage or information
from the server
init() and destroy() – Used for managing resources that are held for the life of
the servlet
getServletInfo() – Returns information about the servlet, such as author,
version, and copyright.
What is JDBC?
•JDBC stands for Java Database Connectivity, which is a standard Java API
for database-independent connectivity between the Java programming
language and a wide range of databases.
JDBC API
Vendor
Java JDBC-ODBC ODBC Data
database
application bridge driver Driver base
library
Type 1: JDBC-ODBC Bridge Driver
Advantages
It is very easy to use
Almost any database is supported
can be easily connected to any database
limitations
Performance will not be efficient
ODBC Driver needs to be installed
Type 1 drivers are not portable
Not suitable for Applets
Type 2 Native-API Driver
JDBC API
Vendor
Java Native API database
Data
application Driver
library base
Type 2 Native-API Driver
Advantages
Faster than type 1 Driver
limitations
Clients Side Library is not available for all databases
Vendor Client Library needs to be installed
It is a Platform Dependent
Not Thread Safe
Type 3: Network Protocol Driver
ADVANTAGES LIMITATIONS
Platform Independent
No Intermediate format is
required Drivers are database
Application connects dependent.
directly to the database
server