Beruflich Dokumente
Kultur Dokumente
Ans:1 (A)
1. (c)
2. (b)
3. ()
4. (c)
Ans: 1(B)
Q- What is JDBC ?
JDBC is a technology that enables the java program to manipulate data stored into the database.
JDBC is Java application programming interface that allows the Java programmers to access
database management system from Java code. It was developed by Java Soft. It provides
interface between relational database and java programming. JDBC is part of java standard
edition J2SE,
2. In case of applet the program is run 2. In case of Servlet the program will run
over the browser and result is sent to over the server & result will sent back
client. to client this will take less time to
execute a program.
Q-What is Cookies?
Cookies are small text files that are stored by an application server in the client browser to keep
track of all the users.
The client saves the cookies in the local hard disk and sends them along with the HTTP request
headers to the server.
Cookies can only be read by the application server that had written them in the client browser.
Cookies can be used by the server to find out the computer name, IP address or any other details
of the client computer by retrieving the remote host address of the client where the cookies are
stored.
Q-2
Ques-1: Differentiate between JSP and Servlet.
Servlet JSP
1. Servlets are pure java programs. 1-But in JSP we can use HTML and Java
code .
2- in jsp client side validation is not
possible.
The MVC paradigm is a way of breaking an application, or even just a piece of an application's
interface, into three parts: the model, the view, and the controller
MVC is often seen in web applications where the view is the HTML or XHTML generated by
the app. The controller receives GET or POST input and decides what to do with it
Model: The model is used to manage information and notify observers when that information
changes. It contains only data and functionality that are related by a common purpose
View: The view or viewport is responsible for mapping graphics onto a device. A viewport
attaches to a model and renders its contents to the display surface.
Controller: Receives input and initiates a response by making calls on model objects.
A controller is the means by which the user interacts with the application. A controller accepts
input from the user and instructs the model and viewport to perform actions based on that input.
Q.3
Ques-1: Explain implicit objects in JSP.
There are several objects that are automatically available in JSP is called implicit object.
These are:
request
response
out
session
pagecontent
application
config
page
exception
JDBC ODBC
1. JDBC is java data base connectivity. 1. ODBC is open data base connectivity.
3. JDBC drivers are written in java and JDBC 3. ODBC requires manual installation of the
code is automatically installable, secure, ODBC driver manager and driver on all
and portable on all platforms. client machines.
4. JDBC is Object-Oriented. 4. ODBC is procedural-oriented.
Q-4
Ques-1: Differentiate between RMI Registry and OSAgent.
RMI Registry OSAgent
2: URL rewriting:
URL rewriting is a session management techniques that manages user session by modifying a
URL.
Usually, this technique is used when information that is to be transferred is not very critical
because the URL can be intercepted easily during transfer.
For example, in an online shopping portal, servlet can modify a URL to include user information,
such as a username.
Hidden form fields are used to maintain the session information of a user while the user interacts
with the web application.
A hidden form field is embedded in an HTML page and is not visible when viewed in a browser.
You can use the classes and interfaces defined in the Servlet Session API to create and manage
user sessions.
Various interfaces provided by the Servlet Session API to create and manage user session are ,
javax.servlet.http.httpSession
javax.servlet.http.HttpSessionListener , and
javax.servlet.http.HttpSessionBindingListener
Q-5
Ques-1: Explain Design pattern.
Ques-2: Write difference between doGet and doPost.
doGet doPost
1. doGet() method is used to get 1. doPost( ) method is used for posting
information, information.
2. by doget() method client can send 2. but in case of dopost() method client
limited amount of data. can send unlimited data.
5. doGet(..) is used when the users tries to 5. doPost(..) method is generally used for
request for any Read Only data. Insertion /updation / deletion of data
Q-6
Ques: Explain Life cycle of Servlet.
The javax.servlet.Servlet interface defines the life cycle methods of the servlet such as
1. init()
2. service()
3. destroy().
Init():
1. The Web container invokes the init() method of the servlet instance during initialization
of the Servlet. The init() method is invoked only once in the servlet life cycle .
2. The init() method throws a ServletException if the Web container cannot initialize the
Servlet resources .
Service():
1. The Web container invokes the service() method to allow a servlet to process a client
request.
2. The service() method is invoked only after the initialization of the servlet is complete.
3. The service() method processes the request and returns the response back to the Web
container.
Destroy():
1. The Web container calls the destroy() method before removing the servlet instance from
the service.
2. The destroy() method is also invoked only once in the a servlet life cycle.
3. The destroy() method marks the end of the life cycle of a servlet.