Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 28

Module 1:-

MCQs

1. How many tiers in Java Enterprise Edition Architecture?

A. 1

B. 2

C. 3

D. 4

2. Java EE, the Java Enterprise Edition, is

A. an improved version of the Java Standard Edition for business professionals


B. a development environment, designed for creating enterprise applications
C. a platform for enterprise class level, distributed applications
D. a replacement of the Java Virtual Machine for running internet applications

3. Which of the following is NOT true

A. Java EE applications are based on 4 phases: development, assembly, deployment, administration


B. Java EE applications are autonomic self-managing, self-healing, self-protecting enterprise
applications
C. Java EE applications are split up in multiple tiers: client tier, web tier, EJB tier and integration
tier
D. Java EE applications are typically a combination of application clients, web components and
business components.

4. Which object of HttpSession can be used to view and manipulate


information about a session?
a. session identifier
b. creation time
c. last accessed time
d. All mentioned above
5. Which class provides stream to read binary data such as image etc.
from the request object?

a. ServltInputStream
b. ServletOutputStream
c. Both A & B
d. None of the above

6. Which of these ways used to communicate from an applet to servlet?

a. RMI Communication
b. HTTP Communication
c. Socket Communication
d. All mentioned above

7. Which methods are used to bind the objects on HttpSession instance


and get the objects?

a. setAttribute
b. getAttribute
c. Both A & B
d. None of the above

8. Which type of ServletEngine is a server that includes built-in support


for servlets?
a. Add-on ServletEngine
b. Embedded ServletEngine
c. Standalone ServletEngine
d. None of the above

9. What type of servlets use these methods doGet(), doPost(),doHead,


doDelete(), doTrace()?
a. Genereic Servlets
b. HttpServlets
c. All of the above
d. None of the above

10. Which cookie it is valid for single session only and it is removed
each time when the user closes the browser?
a. Persistent cookie
b. Non-persistent cookie
c.  All the above
d. None of the above

11. 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

12. Which packages represent interfaces and classes for servlet


API?

a.  javax.servlet
b. javax.servlet.http
c. Both A & B
d. None of the above

13. Which class can handle any type of request so that it is


protocol-independent?

a. GenericServlet
b. HttpServlet
c. Both A & B
d. None of the above

14.  Which HTTP Request method is non-idempotent?

a. GET
b. POST
c. BOTH A & B
d. None of the above

15. Which object is created by the web container at time of


deploying the project?

a. ServletConfig
b. ServletContext
c. Both A & B
d. None of the above
16. What is the lifecycle of a servlet?

a. Servlet class is loaded


b. Servlet instance is created
c. init,Service,destroy method is invoked
d. All mentioned above

17. Which method in session tracking is used in a bit of information


that is sent by a web server to a browser and which can later be read
back from that browser?

a. HttpSession
b. URL rewriting
c. Cookies
d. Hidden form fields

18. 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

19. How many techniques are used in Session Tracking?

a. 4
b. 3
c. 5
d. 2

20. Which of the following code can be used to set the content type for the body of the
response?

a. request.setContentType(type)
b. response.setContentType(type)
c. header.setContentType(type)
d. None of the above.

21. Which of the following architecture is supported by an Enterprise Application?  


a. Single tier
b. Two tier
c. Multi-tier
d. All of the above

Very Short Questions

1. Name the components of Middle layer in Java Enterprise Edition Architecture.


2. Name different versions of Java Edition.
3. What is the full form of JNDI?
4. What is the full form of JMS?
5. What is init() method?
6. What is destroy() method?
7. What is Servlet Interface?
8. What is Servlet API?
9. How many types of APIs in Servlet?
10. What is HTTPRequest?
11. What is HTTPResponse?
12. Name three methods in Java Servlet.
13. What is ODBC Driver?
14. What is the fullform of EIS?

Short Question

1. What are the components of J2EE applications?


2. What are the J2EE client types?
3. What is a J2EE container?
4. What is Dynamic Conent?
5. What is servelt Technology?
6. Explain Java Servlet API?
7. What is Glass fish Server?
8. What is Deployment Descriptor?
9. What is JDBC?
10. What is javax.servlet?
11. What can servlet do?
12. Explain JDBC Architecture.
13. Explain Servlet GUI?
14. Explain Life Cycle of Servlet.
15. What is Request Response Protocol?
Very Long Questions

1. Define Enterprise Application? with the help of a neat diagram illustrate the tiers of an Enterprise
Architecture.
2. List out the Technolgies used in Java EE.
3. With the help of the neat daiagram, illustrate the System Architectures that are used in
Computer Application
4. With the help of a neat diagram, illustrate each and every component used in Multi tier
Architecture
5. Why We use Servlets and What Servlets can do?
6. What are the intefaces used under javax.servlet interface? List out the methods used in all the
interfaces?
7. What are the intefaces used under javax.servlet.http interface? List out the methods used in all
the interfaces?
8. With the help of the neat diagram, illustrate the servlet lifecycle?
9. What is JDBC? what are the different types of JDBC Drivers
10. What are the Steps involved in to acess and work with a database using JDBC?

Module 2:

MCQs:

1. What is the better approach to set some application scoped value stetted from a
servlet

a. getServletContext().setAttribute("foo",barObj);
b. application.setAttribute("foo",barObj);
c. Both are good approach
d. None of these

2. Which method of HttpServletResponse is used to redirect an HTTP request to


another URL?
a. redirectURL()
b. redirectHttp()
c. sendRedirect()
d. getRequestDispatcher()
3. Which deployment descriptor element is used to specify a ServletContext- Listener?
(Select one)
a. <context-listener>
b.  <listener>
c.  <servlet-context-listener>
d. <servletcontextlistener>

4. Which of the following is the right placement for servlet class in a web archive file?
a. /WEB-INF/MyServlet.class
b. /WEB-INF/lib/MyServlet.class
c. /WEB-INF/class/MyServlet.class
d. /WEB-INF/classes/MyServlet.class

5. How should servlet developers handle the HttpServlet’s service() method when
extending HttpServlet?
a. They should override the service() method in most cases.
b. They should call the service() method from doGet() or doPost()
c. They should call the service() method from the init() method.
d. They should override at least one doXXX() method (such as doPost()). 

6. A RequestDispatcher can be obtained from which objects?


a. ServletConfig
b. ServletContext
c. HttpServletRequest
d. HttpServletResponse

7. Which statements about session attributes is not  true? 


a. The return type of HttpSession.getAttribute(String) is Object.
b.  The return type of HttpSession.getAttribute(String) is String.
c. Attributes bound into a session are available to any other servlet that belongs to
the same ServletContext and handles a request identified as being part of the
same session.
d. Calling setAttribute(“keyA”, “valueB”) on an HttpSession which already holds a
value for the key keyA will cause the previous value for this attribute to be
replaced with the String valueB.

8. <context-param>
<param-name>email</param-name>
      <param-value>raj@123</param-value>
</context-param>
a. Can be assessed in any servlet/jsp
b. Can be assessed in any servlet but not in jsp
c. Can be assessed in an servlet in which it is defined
d. None of these

9. //assume imports
public class Test extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws Exception{
PrintWriter out = response.getWriter();
out.println("hello"); out.flush();
request.getRequestDispatcher("/More").forward(request, response);}}
Assuming that Servlet in the path /More gets the PrintStream object and prints
“hello there”, what will happen when the Test servlet is requested?
a. Page displays hello
b. Page displays hello there
c. Page throws IllegalStateException
d. Page prints hello and hello there in 2 lines

10. Which interfaces declare a getSession() method? 


a. ServletRequest
b. ServletResponse
c. HttpServletRequest
d. HttpServletResponse

11. If a client will NOT accept a cookie, which session management mechanism could
the web container employ? (Choose one.)
a. Cookies, but NOT URL rewriting.
b. URL rewriting, but NOT cookies.
c. Either cookies or URL rewriting can be used.
d.  Neither cookies nor URL rewriting can be used.

12. The sendError() and sendRedirect()  sends the status code equivalent to the static
constant
a. SC_NOT_FOUND and SC_MOVED_TEMPORARILY
b. SC_FOUND and SC_MOVED_TEMPORARILY
c. SC_MOVED_TEMPORARILY and SC_NOT_FOUND
d. SC_NOT_FOUND and SC_OK

13. Which is most logically stored as an attribute in session scope?


a. A copy of a query parameter entered by a user.
b. The result of a database query to be returned immediately to a user.
c.  A database connection object used by all web components of the system.
d. An object representing a user who has just logged into the system.

14. What is the recommended way to deal with servlets and thread safety?
a.  Write the servlet code to extend ThreadSafeServlet.
b. Have the servlet implement SingleThreadModel.
c.  Use local variables exclusively, and if you have to use instance variables,
synchronize access to them.
d.  Log all servlet method calls.

15. Which of the following is used to call a stored procedure?


a. Statement
b. PreparedStatement
c. CallableStatment
d. CalledStatement

16. Which of the following is used to limit the number of rows returned?
a. setMaxRows(int i)
b.  setMinRows(int i)
c. getMaxrows(int i)
d. getMinRows(int i)

17. Which of the following is the method of JDBC batch process?


a. setBatch()
b. deleteBatch()
c. removeBatch()
d. addBatch()
18. Which of the following is used to rollback a JDBC transaction?
a. rollback()
b. rollforward()
c. deleteTransaction()
d.  RemoveTransaction()

19. Which of the following is an approach for state maintenance in Web applications?  
a. URL Rewriting
b. Cookies
c. HTTP Session
d. All of the above.

20. Which method of the request object is used to extract values of the input fields in a
form when it is submitted?   
a. getParameter
b. getParameterNames
c. getValues
d. putValues

Very Short Questions:

1. Explain Cookies.
2. Explain advantages of cookies
3. What is servelt session?
4. Write syntax of creating a cookie
5. Write a syntax of deleting a cookie.
6. What is session tracking?
7. Why we use Hidden form filed ?
8. Why we use URL Rewriting?
9. What is request dispatcher interface?
10. Explain HTTP Session interface.
11. Explain constructor of cookie class.
12. What are the different kinds of cookies?
13. Name the methods of Request Dispatcher.
14. Explain getSession().
15. Explain getSession(boolean create).

Short Questions:

1. What is Request Dispatcher?


2. Explain disadvantages of cookies.
3. Explain different methods of cookie class.
4. How to create cookie?
5. How to delete cookie?
6. How to get cookies?
7. Explain Life cycle Of Http Session, Session Tracking With Servlet API,.
8. How to Create and Upload File Application?
9. How to Create a Non- Blocking Read Application?
10. How to create the web application?
11. Explain session tracking techinques.
12. Explain Servlet HTTP Session Login and Logout.
13. How to create Cookies using servlet?
14. Explain Hidden form field.
15. Explain URL Rewriting.

Long Questions:

1. What is Cookies? What are the prameters used in Cookies? Also List out the mandatory
parameter that a Cookie should use.
2. What are the Different Kinds of Cookies?
3. Where are Cookie used?
4. How cookies are Created using Servlet list out various method and syntax used to create
Cookies? also list out methods used in Cookies.
5. What are Sessions? Explain the Steps involved in the lifecycle of an HTTP Session?
6. Briefly Explain the Methods used in Session Tracking.
7. What is Request Dispatcher Interface? Write the Methods used for obtaining an Object
Implementation Request Dispatcher?
8. What are the Methods used in Request dispatcher?
9. What are the Methods used in Downloading the Files?
10. What are the interfaces need to be implemented while using the new non-blocking I/O
technology.

Module 3
MCQs:
1. Which of the following is/are true for JSP technology?        

I. It is persistent.
II. Platform independent.
III. Browser executes the code.

a. Only (I) above


b. Only (II) above
c. Both (I) and (II) above
d. Both (II) and (III) above

2. Which of the following is true for JNDI?             

a. Database service
b. Naming and Directory Service
c. Network Service
d. Web Service

3. Which is least visibility scope for Java bean in JSP?               

a. Page
b. Session
c. Request
d. Application
4. Which method of the servlet is/are called several times in its life?  

a. init()
b. doPost() 
c. destroy()
d. Both (a) and (b) above

5. Which of the following are not an implicit object in JSP?      

I. Request. 
II. Session. 
III. Vector. 
IV. In.

a. Both (I) and (II) above


b. Both (I) and (III) above 
c. Both (II) and (IV) above 
d. Both (III) and (IV) above.

6. Which of the following is not true for <jsp:useBean> tag in JSP page?  

a. Locates a bean instance


b. Stores object reference of the bean in a variable
c. Creates an instance if fails to locate the bean instance
d. Does not execute the body tag if any

7. Which of the following is true for Java Bean?    

a. It can not be a GUI component


b. It never implements serializable interface
c. It has zero-argument constructor
d. It is a distributed component

8. Which of the following is used to redirect the response from a servlet


to a JSP page? 

a. response.sendRedirect() 
b. request.sendRedirect() 
c. request.forward()
d. response.forward() 

9. Which of the following property of Java Bean represents a single


value?     

a. Simple property 
b. Boolean property 
c. Indexed property
d. Both (a) and (b) above

10.Which of the following allows substitution of code to occur at the


translation time in a JSP page?                                 

a. <jsp:include> Tag
b. <@ include> directive
c. <@ page > directive
d. Declaration block

11.Which EJB uses EJB-QL for query operations?            

a. BMP Entity Bean 


b. CMP Entity Bean
c. Session Bean
d. Message-Driven Bean

12.Which object is used to forward the request processing from one


servlet to another?    

a. ServeltContext
b. ServletConfig
c. RequestDispatcher
d. ResponseDispatcher

13. Which case of a session bean obtains the UserTransaction object via the
EJBContext using the getUserTransaction() method in EJB transaction
management?

a. Bean-managed transactions
b. Container-managed transactions
c. Both A & B
d. None of the above

14. Abbreviate the term JMS?


a. Java Message Service
b. Java Monitor Service
c. Java Message Session
d. Java Monitor Session

15. 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

16. 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

17. 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

18. EJB is like COM, Abbreviate the term COM?


a. Component Object Model
b.  Component Oriented Model
c. Common Object Model
d. Common Oriented Model

19. What represents a persistent global data from the database?

a. Entity Bean
b. Session Bean
c. Both A & B
d. None of the above
20. Which middleware services are provided by EJB?
a. Security
b. Transaction Management
c. Both A & B
d. None of the above

Very Short Questions:

1. What is the full form of JSP?


2. Write one disadvantage of JSP.
3. What is Servlet?
4. What is the full form of GUI?
5. What are JSP Elements?
6. What are comments in JSP?
7. What is Implicit Object?
8. What do you mean by Tags?
9. What is the full form of JSTL?
10. Write down any two Tag Libraries.

Short Questions:

1. Explain about Java Server Pages?


2. Explain Disadvantages Of JSP.
3. How many phases are present in JSP Page.
4. How does a JSP function?
5. How does JSP execute?
6. Write down the characteristics of JSP.
7. Explain about JSP GUI Example.
8. How to Forward JSP Page to Another Page?
9. How we can Pass Parameters for other Actions in JSP.
10. How to Load a Java bean?
11. What is wrong in using JSP Scriptlet Tags?Explain
12. What are the disadvantages of JSTL?
13. What are Action Elements? What are its uses?
14. What are the advantage of using JSP Document ?
15. What are the Disadvantage of JSP?
Long Questions:

1. What is Java Server Page Technology? Why do we use Java Server Pages ? Explain in
Details.
2. With the hep of a neat diagram illustrate the Lifecycle of a JSP page?
3. Write the Syntax used to
a. Format the Numbers
b. Parsing Numbers
c. Formatting the Date
d. Parsing the Date
e. Time Zones

4. Write the Syntax for the following


a. Iterator Action
b. URL- Related Action
c. sending an HTTP to a Client

5. How does JSTL Fixes JSP Scriptets Shortcomming ?


6. List out different types of Colection Operation Used in Unified EL?
7. List out the Literals and Operators used in JSP Unified EL
8. What are the Types of Expression Used in Unified EL
9. Write down the Syntax for the Following Unified EL Evaluation
a. Immediate Evaluation
b. Deffered Evaluation
10. How do we Forward one JSP Page to another one ? write the syntax for the Following?

Module 4:

MCQs:
19. 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

2. How many types of session beans are available in EJB?

a. 2
b. 3
c. 4
d. 5

3. 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

4. Which ways are used by the Log4j and Logback frameworks in hibernate framework to
support logging?
a. By log4j.xml file
b. By log4j.properties
c. Both A & B
d. None of the above

5. Which of the following is correct about Data Source in EJB persistence API?
a. It is a persistent object representing the data-store record. It is good to be
serializable.
b. it is an interface to do data operations like add/delete/update/find on
persistent object. It also helps to execute queries using Query interface.
c. It describes the properties of persistence mechanism.
d. It describes the data-store related properties like connection url. user-
name,password etc.

6. Which of the following is correct about description attribute in


@javax.ejb.MessageDrivenBean annotation?

a. It is used to specify name of the message driven bean.

b. it is used to specify message listener interface for the message driven bean.
c. It is used to specify the configuration details of the message-driven bean in
operational environment of the message driven bean.
d. It is used to provide description of the message driven bean.

7. Which of the following annotation is used to specify callback method of ejb


lifecycle?
a. @javax.ejb.PostActivate
b. @javax.ejb.Local
c. @javax.ejb.Remote
d. @javax.ejb.EJB

8. Which of the following is correct about @PostConstruct annotation for a callback method?
a. Method is invoked when a bean is created for the first time.
b. Method is invoked when a bean is removed from the bean pool or is destroyed.
c. Method is invoked when a bean is loaded to be used.
d. Method is invoked when a bean is put back to bean pool.

9. Which annotation is used to inject an ejb into another ejb?


a. @EJB
b. @Resource
c. Both of the above.
d. None of the above.

10. Which of the following is true about System level exception in EJB?
a. If business rule is voilated or exception occurs while executing the business logic will be
treated as system level exception.
b. Any exception which is not caused by business logic or business code.
RuntimeException, RemoteException are SystemException will be treated as system
level exception.
c. Both of the above.
d. None of the above.
11. Which statement describe about JMS is NOT true?
a. JMS supports Publish/Subcribe
b. JMS enhances access to email services
c. JMS use JNDI to locate the destination
d. None of the above
12. Which statement describe about Message-Driven Beans is correct?

a. Message-Driven Beans are stateful


b. An EJB 3.0 message-driven beans can itself be the client of another message-driven
beans
c. The bean mediates between the client and the other components of the application,
presenting a simplified view to the client.
d. None of the above
13. Which is a valid PostConstruct method in a message-driven bean class?
a. @PostConstruct , public boolean init() { return true; }
b. @PostConstruct, private static void init() {}
c. @PostConstruct , private void init() {}
d. @PostConstruct, public static void init() {}

14. Which statement about an entity instance lifecycle is correct?

a. A new entity instance is an instance with a fully populated state.


b. A detached entity instance is an instance with no persistent identity.
c. A removed entity instance is NOT associated with a persistence context.
d. A managed entity instance is the instance associated with a persistence context.

15. Which is NOT a correct statement about entity beans?

a. They are used to store persistent data

b. They are used to share data among clients

c. They are used to implement business processes

d. They are used to represent data stored in a RDBMS


16. Which statement about entity manager is true?

a. A container-managed entity manager must be a JTA entity manager.


b. An entity manager injected into session beans can use either JTA or resource-local
transaction control.
c. An entity manager created by calling the EntityManagerFactory.createEntityManager
method always uses JTA transaction control.

17. Which is NOT Enterprise Beans?

a. Business Beans
b. Entity Beans
c. Session Beans
d. Message-Driven Beans

18. Which is NOT associated with the business tier in a JEE (J2EE) web-based application?
a. JSP
b. Entity Beans
c. Stateless Session Beans
d. None of the above

19. Which of the following elements defines the properties of an attribute that a tag needs?
a. Attribute
b. tag-attribute
c. tag-attribute-type
d. attribute-type

21. Which element defined within the taglib element of taglib descriptor file is
required?
a. Tag
b. Descriptor
c. Validator
d. Name
Very Short Questions:

1. What is the full form of EJB?


2. What is EJB?
3. Enterprise Bean Application?
4. What is Session Beans?
5. What is Remote Interface?
6. What is Local Interface?
7. What is Stateful Session beans?
8. What is MessageDriven Bean?
9. What is Request
10. What is Interceptor?
11. What is AroundInvokeMethod?
12. What is the ful form of JNDI?

Short Questions:

1. What is EJB Architecture?


2. What are the types of Enterprise Bean?
3. What are the different types of session beans?How to use session beans?
4. What do you mean by remote and local interfaces? How to access them?
5. What are the examples of stateful session beans and stateless session beans and singleton
session beans.
6. What is Messsage driven beans? Explain the Uses of Message Driven Beans?
7. How to define an Interceptor?
8. How to add aqn Interceptor To an Enterprise Bean?
9. How to Build and Run the WebApplication.
10. What is Java Naming and Directory interface?Explain in details
11. What is Datasource Resource Definition in Java EE?
12. Write down the Message Driven Beans Example.
13. Write down the example of Singleton Session Beans.
Long Questions:

1. Explain Enterprise Bean architecture.


2. Explain Enterprise Bean Server.
3. Explain EJB Containers? What are the Benefits of EJB?
4. How can we access EJB?
5. What are the different types of Session Bean?
6. With the help of neat diagram, illustrate Lifecycle of Enterprise Java Bean? a. stateful
session Bean
b. Stateless Session Bean
c. singleton session Bean

7. With the help of the neat diagram explain naming Services.


8. Explain Interceptor. How to add an Interceptor To an Enterprise Bean?
9. What is Message Driven Beans? Explain the Life cycle of a Message Driven Bean?
10. Explain Enterprise beans with its Life cycle.

Module 5
MCQs:
17. What does the Session object hold?
e. First Level Cache
f. Second Level Cache
g. Both A & B
h. None of the above

2. In the elements of Hibernate architecture is a factory of session and client of


ConnectionProvider, It holds the second level cache (optional) of data is _____.

a. Session
b. SessionFactory
c. Transaction
d. ConnectionProvider
3. In case of Table per Concrete class, there will be three tables in the database having no
relations to each other. Which are the ways to map the table?
e. By union-subclass element
f. By self-creating the table for each class
g. Both A & B
h. None of the above

4. Abbreviate the term HQL?


e. Hibernate Queue Language
f. Hibernate Query Language
g. Hipher Query Language
h. None of the above

5. Which method is easy for a java programmer to add a criteria?


e. HCQL
f. HQL
g. SQL
h. None of the above

6. Hibernate is an?
e. Open Source
f. Lightweight
g. ORM
h. All mentioned above

7. Which of these simplifies an Object Relational Mapping tool?

e. Data creation
f. Data manipulation
g. Data access
h. All mentioned above

8. How many layers are available in Hibernate architecture?


a. 3
b. 4
c. 5
d. 2

9. What are the JPA @Entity association attributes?

a. Association validation
b. Association cascade behavior
c. Association multiplicity
d. Association direction

10.  JPA implementation is provided by ---?


a. Hibernate
b. Toplink
c. Ibatis
d. All of them

11. What is the Life Cycle Of A Jpa Entity?


e. New / Transient
f. Managed / Persisted
g. Detached
h. All of the above

12. Object/relational metadata can be specified directly in the entity class file by using
annotations, or in a separate ________ descriptor file distributed with the application.
a. Scalable Vector Graphics
b. HTML
c. XML’
d. XHTML

13. Which attribute of @OneToMany is used to mark an entity as owned?


a.  Cascade
b. mappedBy
c. propertyRef
d.  None

14. What is the JPA equivalent of hibernate.cfg.xml file?


a. configuration.xml
b. persistence.xml
c.  jpa.configuration.xml
d. None

15. What is TRUE about the cascading and cascade mode attributes in Entity Beans?
a. Cascade mode attributes can be specified for the association annotaions (like
@OneToMany) in an entity bean
b. The cascading direction is from the target entity to the source entity
c. PERSIST, DELETE and REFRESH are cascading mode attributes
d. Refresh cascade causes to refresh the target entities of a relationship when refresh is
invoked on the source entity of the relationship

16. Which of the following is true about detached state of a persistent entity?
a. Once we close the Hibernate Session, the persistent instance will become a detached
instance.
b. A new instance of a persistent class which is not associated with a Session.
c. You can make a transient instance detached by associating it with a Session.
d. None of the above.
17. Which element of hbm.xml defines maps the unique ID attribute in class to the primary
key of the database table?
a. Id
b. Generator
c. Primary key
d. None of the above
18. Which of the following element maps java.util.Map property in hibernate?
a. <set>
b. <list>
c. <bag>
d. <map>

19. Which of the following element is used to represent one-to-many relationship in


hibernate?
a. <one-to-many>
b. <one-many>
c. <OneToMany>
d. None of the above.

20. Which of the following is true about HQL?


a. Hibernate supports named parameters in its HQL queries.
b. HQL supports a range of aggregate methods, similar to SQL.
c. Both of the above.
d. None of the above.
Very Short Questions:
1. What is the full form of ORM?
2. What is the full from of JPA?
3. What is persistence in java?
4. What is Java Persistence API?
5. What is Hibernate?
6. What is Entity?
7. What is one JPA Layer?
8. What is many to one relationship?
9. What is JDBC Layer?
10. What is Java bean Class?

Short Questions:
1. What is persistence in JPA?Explain
2. Explain the architecture of JPA
3. How JPA works?
4. What is Hibernate? Why Hibernate?
5. How Hibernate Works?
6. How to run The JPA Application?
7. How to run the Hibernate Application?
8. Explain the architecture of Hibernate with the help of diagram.
9. Explain the JPA Application Structure.
10. How to create Persistence Unit?

Long Questions:

1. What are the Components of Hibernate ?


2. What is Hibernate ?What is the Architecture of Hibernate ?
3. What are the advantages of Object Relatonal Mapping ?
4. How does Mapping between Class and Database happen ?
5. What do you understand by the term Serialization ?
6. Explain Persistence of Object Oriented Model?
7. How to Create Database and Tables in Mysql with Hibernate application.
8. How to add the Required Library Files in JPA?
9. How to create a Java bean Class with Hibernate application.
10. How to Create JSPS in Hibernate application.

You might also like