Deck 2: EJB, Servlets, and JNDI
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
Play
Full screen (f)
Deck 2: EJB, Servlets, and JNDI
1
Which EJB container must provide an implementation of Java Naming and Directory Interface (JNDI) API to provide naming services for EJB clients and components?
A)Transaction support
B)Persistence support
C)Naming support
D)All mentioned above
A)Transaction support
B)Persistence support
C)Naming support
D)All mentioned above
Naming support
2
EJB is a specification for J2EE server, not a product; Java beans may be a graphical component in IDE.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
True
3
A session bean represents a multiple clients inside the Application Server.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
False
4
Which component does the Entity bean represent the persistent data stored in the database?
A)Server-side component
B)Client-side component
C)server and client side component
D)None of the above
A)Server-side component
B)Client-side component
C)server and client side component
D)None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
EJB is like COM, Abbreviate the term COM?
A)Component Object Model
B)Component Oriented Model
C)Common Object Model
D)Common Oriented Model
A)Component Object Model
B)Component Oriented Model
C)Common Object Model
D)Common Oriented Model
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
JMS is also known as a messaging service.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
What represents a persistent global data from the database?
A)Entity Bean
B)Session Bean
C)Both A & B
D)None of the above
A)Entity Bean
B)Session Bean
C)Both A & B
D)None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
Which component does the Entity bean represents the persistent data stored in the database?
A)Server-side component
B)Client-side component
C)server and client side component
D)None of the above
A)Server-side component
B)Client-side component
C)server and client side component
D)None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
In EJB, middleware services are provided by EJB Container automatically.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
Which middleware services are provided by EJB?
A)Security
B)Transaction Management
C)Both A & B
D)None of the above
A)Security
B)Transaction Management
C)Both A & B
D)None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
Which server-side component is required to be deployed on the server?
A)EJB
B)RMI
C)Both A & B
D)None of the above
A)EJB
B)RMI
C)Both A & B
D)None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
Which type of instances retain no data or conversational state for a specific client?
A)Message-Driven Bean
B)Session Bean
C)Entity Bean
D)None of the above
A)Message-Driven Bean
B)Session Bean
C)Entity Bean
D)None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
EJB technology is built on the top of Socket Programming
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
How constructor can be used for a servlet?
A)Initialization
B)Constructor function
C)Initialization and Constructor function
D)Setup() method
A)Initialization
B)Constructor function
C)Initialization and Constructor function
D)Setup() method
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
Can servlet class declare constructor with ServletConfig object as an argument?
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
Java Servletsare efficient and powerful solution for creating ............for the web.
A)dynamic content
B)static content
C)hardware
D)both and b
A)dynamic content
B)static content
C)hardware
D)both and b
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
.......... is the first phase of the servlet life cycle.
A)Initialization
B)Service
C)Destruction
D)Both a and b
A)Initialization
B)Service
C)Destruction
D)Both a and b
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
The service phase of the servlet life cycle represents all interactions with requests until the servlet is ...........
A)created
B)running
C)initiated
D)destroyed
A)created
B)running
C)initiated
D)destroyed
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
GET methods are great for sending ..........amounts of information that you do not mind having visible in a URL.
A)negligible
B)huge
C)small
D)both and b
A)negligible
B)huge
C)small
D)both and b
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
Several vendors are adding ........... to their existing database .........
A)JDOBC, middle-ware products
B)JDBC drivers, upper-ware products
C)middle-ware products, JDOBC drivers
D)JDBC drivers, middle-ware products
A)JDOBC, middle-ware products
B)JDBC drivers, upper-ware products
C)middle-ware products, JDOBC drivers
D)JDBC drivers, middle-ware products
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
Which of the following code is used to get an attribute in a HTTP Session object in servlets?
A)session.getAttribute(String name)
B)session.alterAttribute(String name)
C)session.updateAttribute(String name)
D)session.setAttribute(String name)
A)session.getAttribute(String name)
B)session.alterAttribute(String name)
C)session.updateAttribute(String name)
D)session.setAttribute(String name)
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
A servlet needs to acquire a data source through a JNDI naming lookup. Which of the following is the best place to do this?
A)Constructor
B)init method
C)service method
D)doGet method
A)Constructor
B)init method
C)service method
D)doGet method
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
What's the difference between servlets and applets? a. Servlets executes on Servers, where as
A)Applets executes on Browser
B)Servlets have no GUI, where as an Applet has GUI
C)Servlets creates static web pages, where as Applets creates dynamic web pages
D)Servlets can handle only a single request, where as Applet can handle multiple requests
A)Applets executes on Browser
B)Servlets have no GUI, where as an Applet has GUI
C)Servlets creates static web pages, where as Applets creates dynamic web pages
D)Servlets can handle only a single request, where as Applet can handle multiple requests
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
Which of the following code retrieves the body of the request as binary data?
A)DataInputStream data = new InputStream()
B)DataInputStream data = response.getInputStream()
C)DataInputStream data = request.getInputStream()
D)DataInputStream data = request.fetchInputStream()
A)DataInputStream data = new InputStream()
B)DataInputStream data = response.getInputStream()
C)DataInputStream data = request.getInputStream()
D)DataInputStream data = request.fetchInputStream()
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
When destroy() method of a filter is called?
A)The destroy() method is called only once at the end of the life cycle of a filter
B)The destroy() method is called after the filter has executed doFilter method
C)The destroy() method is called only once at the begining of the life cycle of a filter
D)The destroyer() method is called after the filter has executed
A)The destroy() method is called only once at the end of the life cycle of a filter
B)The destroy() method is called after the filter has executed doFilter method
C)The destroy() method is called only once at the begining of the life cycle of a filter
D)The destroyer() method is called after the filter has executed
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck