Professional Documents
Culture Documents
1. What is Servlet?
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 webserver, process the
request, produce the response, then send a response back to the webserver.
3. Robust:
By inheriting the top features of Java (such as Garbage collection, Exception
handling, Java Security Manager etc.) the servlet is less prone to memory
management issues and memory leaks. This makes development of web
application in servlets secure and less error prone.
Integration Servlets are tightly integrated with the server. Servlet can
use the server to translate the file paths, check authorization, perform
logging and MIME type mapping etc.
Persistent: Servlets remain in memory until explicitly destroyed. This
helps in serving several incoming requests. Servlets establishes
connection only once with the database and can handle several
requests on the same database.
Server Independent: Servlets are compatible with any web server
available today.
Protocol Independent: Servlets can be created to support any
protocols like FTP commands, Telnet sessions, NNTP newsgroups, etc.
It also provides extended support for the functionality of HTTP protocol.
Fast: Since servlets are compiled into bytecodes, they can execute more
quickly as compared to other scripting languages. The bytecode
compilation feature helps servlets to give much better performance. In
addition, it also provides advantage of strong error and type checking.
6.What is JDBC?
JDBC or Java Database Connectivity is a Java API to connect and execute the
query with the database. It is a specification from Sun microsystems that
provides a standard abstraction(API or Protocol) for java applications to
communicate with various databases. It provides the language with java
database connectivity standards. It is used to write programs required to
access databases. JDBC, along with the database driver, can access databases
and spreadsheets. The enterprise data stored in a relational database(RDB) can
be accessed with the help of JDBC APIs.
Definition of JDBC(Java Database Connectivity)
JDBC is an API(Application programming interface) used in java programming
to interact with databases. The classes and interfaces of
JDBC allow the application to send requests made by users to the specified
database.
Purpose of JDBC
Enterprise applications created using the JAVA EE technology need to interact
with databases to store application-specific information. So, interacting with a
database requires efficient database connectivity, which can be achieved by
using the ODBC(Open database connectivity) driver. This driver is used with
JDBC to interact or communicate with various kinds of databases such as
Oracle, MS Access, Mysql, and SQL server database.
A ResultSet object maintains a cursor that points to the current row in the
result set. The term "result set" refers to the row and column data contained in
a ResultSet object.
JSP stands for Java Server Pages, and it’s a server side technology. It’s used for
creating web applications and dynamic web content. The main property of JSP
is that we can insert our java code inside our HTML page using JSP tag. JSP
provides you platform-independent pages.
request:
This variable specifies the data included in a http request. This variable takes
value from the clients' browser to pass it over to the server.reponse:
This variable specifies the data included in the http response. It is used with
cookies and also in http headers.
out:
This variable specifies the data associated with httpsession object with a
specific session of a user. The main purpose of this object is to use the session
information to maintain multiple page requests.
application:
This variable is used to store the environment for the page like page attributes,
access to the request, response and session objects.
page:
This variable is used to store the instance of the generated java servlet.