EJB MT solutions of Niit Ques. 1 to 25
SNo: 1
Ques: What is an Entity Manager
Options:
1, It is the service object that manages entity life-cycle instances.
2, It is a set of entity instances.
3, It is a unique value used by the persistence provider.
4, It is a value that is used to map the entity instance to the corresponding table row in the database.
Answer: 1
Marks: 1
=============================================================
SNo: 2
Ques: Which of the following properties of an entity specifies the propagation of the effect of an operation to associated entities
Options:
1, Cascade
2, Ownership
3, Cardinality
4, Direction
Answer: 1
Marks: 1
=============================================================
SNo: 3
Ques: Which of the following entity manager methods forces the synchronization of the database with entities in the persistence context
Options:
1, flush
2, refresh
3, contains
4, merge
Answer: 1
Marks: 1
=============================================================
SNo: 4
Ques: Which of the following options is true about mapped superclass
Options:
1, It is a plain Java technology interface that is designated with the MappedSuperclass annotation.
2, It is created to provide state and the corresponding object/relational mapping information to child classes through the inheritance mechanism.
3, It can be passed as arguments to methods of the EntityManager or Query interfaces.
4, It is a target of a persistent relationship.
Answer: 2
Marks: 1
=============================================================
SNo: 5
Ques: Which of the following options is a static query expressed in metadata
Options:
1, Named query
2, Query language
3, Query object
4, Native query
Answer: 1
Marks: 1
=============================================================
SNo: 6
Ques: Which of the following options can be compiled to a target language, such as SQL, of a database or other persistent store
Options:
1, Java Persistence Query Language
2, Named query
3, Query object
4, Native query
Answer: 1
Marks: 1
=============================================================
SNo: 7
Ques: What requirement does the GROUP BY clause impose on the SELECT clause
Options:
1, Item that appears in the SELECT clause including the arguments to an aggregate function, must also appear in the GROUP BY clause.
2, Item that appears in the SELECT clause, other than as an argument to an aggregate function, must also appear in the GROUP BY clause.
3, Item that appears in the GROUP BY clause must also appear in the SELECT clause.
4, Item that appears in the SELECT clause should not appear in the GROUP BY clause.
Answer: 2
Marks: 1
=============================================================
SNo: 8
Ques: Which of the following methods will you use to control the start position of the result set in a query
Options:
1, setFirstResult(int startPosition)
2, SetFirstResult(int startPosition)
3, startPosition()
4, setParameter(int startPosition)
Answer: 1
Marks: 1
=============================================================
SNo: 9
Ques: Which of the following QL statements operates on the underlying persistence store, such as database
Options:
1, SELECT
2, UPDATE
3, DELETE
4, WHERE
Answer: 1
Marks: 1
=============================================================
SNo: 10
Ques: Which of the following callback annotations can be used to designate a callback method defined in an entity class
Options:
1, PostConstruct
2, PreDestroy
3, PostActivate
4, PreRemove
Answer: 4
Marks: 1
=============================================================
SNo: 11
Ques: Which of the following statements identifies an interceptor
Options:
1, It is a class that works in conjunction with a bean class to interpose on business method invocations and receive life-cycle callback notifications.
2, It is a method that intercepts the invocation of a business method of a session bean or listener method of a message-driven bean.
3, It is a method that intercepts life-cycle events generated by session bean and message-driven bean instances.
4, It is a method that intercepts the invocation of a business method of a entity bean or listener method of a message-driven bean.
Answer: 1
Marks: 1
=============================================================
SNo: 12
Ques: Which of the following TimerService interface method is used to create an absolute time notification timer
Options:
1, createTimer(long initialDuration, long intervalDuration, Serializable info)
2, createTimer(long duration, Serializable info)
3, createTimer(Date expiration, Serializable info)
4, createTimer(Date initialExpiration, long intervalDuration, Serializable info)
Answer: 3
Marks: 1
=============================================================
SNo: 13
Ques: Which of the following tasks will you perform in a method that contains a valid reference to a timer object
Options:
1, Notify the enterprise bean about all expired timers
2, Interrogate a timer callback notification
3, Obtain a list of outstanding timer notifications
4, Process a timer callback notification
Answer: 2
Marks: 1
=============================================================
SNo: 14
Ques: By using which of the following methods the enterprise bean obtains a reference to the TimerService object
Options:
1, ejbTimeout method
2, getTimers method
3, getNextTimeout method
4, getTimerService method
Answer: 4
Marks: 1
=============================================================
SNo: 15
Ques: Which of the following options is used to implement Container Managed Transaction (CMT) to methods
Options:
1, To apply CMT to the methods of an enterprise bean, the application assembler should, on a method-by-method basis, consider the suitability of accepting the EJB 3.0 default transaction policy.
2, To implement CMT to methods, you must code the required transaction policy in the enterprise bean method.
3, To apply CMT to methods, do not specify the transactional behavior of the enterprise bean.
4, To implement CMT methods, you must code the required transaction policy in the session bean method.
Answer: 1
Marks: 1
=============================================================
SNo: 16
Ques: What will you do when a client method invocation does not have an accompanying transaction context
Options:
1, Run the enterprise bean method in a new transaction
2, Run the enterprise bean method in the caller's transaction context
3, Suspend the callers transaction context and run the enterprise bean method in a new transaction
4, Suspend the callers transaction context and run the enterprise bean method without a transaction
Answer: 1
Marks: 1
=============================================================
SNo: 17
Ques: Which of the following CMT transaction attributes is applicable for methods that must always execute in the callers transaction
Options:
1, REQUIRED
2, SUPPORTS
3, REQUIRES_NEW
4, MANDATORY
Answer: 4
Marks: 1
=============================================================
SNo: 18
Ques: Which of the following CMT transaction attributes is supported by the following enterprise beans:
Stateless session bean
Stateful session bean
Message-Driven bean
Options:
1, REQUIRED
2, SUPPORTS
3, REQUIRES_NEW
4, MANDATORY
Answer: 1
Marks: 1
=============================================================
SNo: 19
Ques: In which of the following authentication methods a public key certificate is exchanged in Secure Socket Layer (SSL)
Options:
1, HTTP basic
2, Client certificate
3, Form-based
4, Identification
Answer: 2
Marks: 1
=============================================================
SNo: 20
Ques: Which of the following options defines JTA
Options:
1, It enables the software components to initiate and monitor distributed transactions.
2, It specifies the implementation of a transaction manager.
3, It is used to integrate an application server with an external security infrastructure.
4, It is used for vendor-neutral access to directory services, such as NIS+.
Answer: 1
Marks: 1
=============================================================
SNo: 21
Ques: Which of the following JAVA EE platform roles uses tools to produce JAVA EE applications and components
Options:
1, System Administrator
2, Application Component Provider
3, Application Assembler
4, Tools Provider
Answer: 2
Marks: 1
=============================================================
SNo: 22
Ques: Which of the following options is a server-side client resource
Options:
1, Database tier
2, MDB
3, Entity bean
4, Session bean
Answer: 4
Marks: 1
=============================================================
SNo: 23
Ques: Which of the following options is used to obtain security information of the EJB objects
Options:
1, EJBObject
2, SessionContext
3, Context
4, @Resource
Answer: 2
Marks: 1
=============================================================
SNo: 24
Ques: Which of the following access modifier cannot be applied to a callback method
Options:
1, transient
2, protected
3, public
4, private
Answer: 1
Marks: 1
=============================================================
SNo: 25
Ques: Which of the following options assigns the name of the entity class as the default name to the database table
Options:
1, Java Persistence API
2, @Table annotation
3, LOB annotation
4, Basic annotation
Answer: 1
Marks: 1
SNo: 1
Ques: What is an Entity Manager
Options:
1, It is the service object that manages entity life-cycle instances.
2, It is a set of entity instances.
3, It is a unique value used by the persistence provider.
4, It is a value that is used to map the entity instance to the corresponding table row in the database.
Answer: 1
Marks: 1
=============================================================
SNo: 2
Ques: Which of the following properties of an entity specifies the propagation of the effect of an operation to associated entities
Options:
1, Cascade
2, Ownership
3, Cardinality
4, Direction
Answer: 1
Marks: 1
=============================================================
SNo: 3
Ques: Which of the following entity manager methods forces the synchronization of the database with entities in the persistence context
Options:
1, flush
2, refresh
3, contains
4, merge
Answer: 1
Marks: 1
=============================================================
SNo: 4
Ques: Which of the following options is true about mapped superclass
Options:
1, It is a plain Java technology interface that is designated with the MappedSuperclass annotation.
2, It is created to provide state and the corresponding object/relational mapping information to child classes through the inheritance mechanism.
3, It can be passed as arguments to methods of the EntityManager or Query interfaces.
4, It is a target of a persistent relationship.
Answer: 2
Marks: 1
=============================================================
SNo: 5
Ques: Which of the following options is a static query expressed in metadata
Options:
1, Named query
2, Query language
3, Query object
4, Native query
Answer: 1
Marks: 1
=============================================================
SNo: 6
Ques: Which of the following options can be compiled to a target language, such as SQL, of a database or other persistent store
Options:
1, Java Persistence Query Language
2, Named query
3, Query object
4, Native query
Answer: 1
Marks: 1
=============================================================
SNo: 7
Ques: What requirement does the GROUP BY clause impose on the SELECT clause
Options:
1, Item that appears in the SELECT clause including the arguments to an aggregate function, must also appear in the GROUP BY clause.
2, Item that appears in the SELECT clause, other than as an argument to an aggregate function, must also appear in the GROUP BY clause.
3, Item that appears in the GROUP BY clause must also appear in the SELECT clause.
4, Item that appears in the SELECT clause should not appear in the GROUP BY clause.
Answer: 2
Marks: 1
=============================================================
SNo: 8
Ques: Which of the following methods will you use to control the start position of the result set in a query
Options:
1, setFirstResult(int startPosition)
2, SetFirstResult(int startPosition)
3, startPosition()
4, setParameter(int startPosition)
Answer: 1
Marks: 1
=============================================================
SNo: 9
Ques: Which of the following QL statements operates on the underlying persistence store, such as database
Options:
1, SELECT
2, UPDATE
3, DELETE
4, WHERE
Answer: 1
Marks: 1
=============================================================
SNo: 10
Ques: Which of the following callback annotations can be used to designate a callback method defined in an entity class
Options:
1, PostConstruct
2, PreDestroy
3, PostActivate
4, PreRemove
Answer: 4
Marks: 1
=============================================================
SNo: 11
Ques: Which of the following statements identifies an interceptor
Options:
1, It is a class that works in conjunction with a bean class to interpose on business method invocations and receive life-cycle callback notifications.
2, It is a method that intercepts the invocation of a business method of a session bean or listener method of a message-driven bean.
3, It is a method that intercepts life-cycle events generated by session bean and message-driven bean instances.
4, It is a method that intercepts the invocation of a business method of a entity bean or listener method of a message-driven bean.
Answer: 1
Marks: 1
=============================================================
SNo: 12
Ques: Which of the following TimerService interface method is used to create an absolute time notification timer
Options:
1, createTimer(long initialDuration, long intervalDuration, Serializable info)
2, createTimer(long duration, Serializable info)
3, createTimer(Date expiration, Serializable info)
4, createTimer(Date initialExpiration, long intervalDuration, Serializable info)
Answer: 3
Marks: 1
=============================================================
SNo: 13
Ques: Which of the following tasks will you perform in a method that contains a valid reference to a timer object
Options:
1, Notify the enterprise bean about all expired timers
2, Interrogate a timer callback notification
3, Obtain a list of outstanding timer notifications
4, Process a timer callback notification
Answer: 2
Marks: 1
=============================================================
SNo: 14
Ques: By using which of the following methods the enterprise bean obtains a reference to the TimerService object
Options:
1, ejbTimeout method
2, getTimers method
3, getNextTimeout method
4, getTimerService method
Answer: 4
Marks: 1
=============================================================
SNo: 15
Ques: Which of the following options is used to implement Container Managed Transaction (CMT) to methods
Options:
1, To apply CMT to the methods of an enterprise bean, the application assembler should, on a method-by-method basis, consider the suitability of accepting the EJB 3.0 default transaction policy.
2, To implement CMT to methods, you must code the required transaction policy in the enterprise bean method.
3, To apply CMT to methods, do not specify the transactional behavior of the enterprise bean.
4, To implement CMT methods, you must code the required transaction policy in the session bean method.
Answer: 1
Marks: 1
=============================================================
SNo: 16
Ques: What will you do when a client method invocation does not have an accompanying transaction context
Options:
1, Run the enterprise bean method in a new transaction
2, Run the enterprise bean method in the caller's transaction context
3, Suspend the callers transaction context and run the enterprise bean method in a new transaction
4, Suspend the callers transaction context and run the enterprise bean method without a transaction
Answer: 1
Marks: 1
=============================================================
SNo: 17
Ques: Which of the following CMT transaction attributes is applicable for methods that must always execute in the callers transaction
Options:
1, REQUIRED
2, SUPPORTS
3, REQUIRES_NEW
4, MANDATORY
Answer: 4
Marks: 1
=============================================================
SNo: 18
Ques: Which of the following CMT transaction attributes is supported by the following enterprise beans:
Stateless session bean
Stateful session bean
Message-Driven bean
Options:
1, REQUIRED
2, SUPPORTS
3, REQUIRES_NEW
4, MANDATORY
Answer: 1
Marks: 1
=============================================================
SNo: 19
Ques: In which of the following authentication methods a public key certificate is exchanged in Secure Socket Layer (SSL)
Options:
1, HTTP basic
2, Client certificate
3, Form-based
4, Identification
Answer: 2
Marks: 1
=============================================================
SNo: 20
Ques: Which of the following options defines JTA
Options:
1, It enables the software components to initiate and monitor distributed transactions.
2, It specifies the implementation of a transaction manager.
3, It is used to integrate an application server with an external security infrastructure.
4, It is used for vendor-neutral access to directory services, such as NIS+.
Answer: 1
Marks: 1
=============================================================
SNo: 21
Ques: Which of the following JAVA EE platform roles uses tools to produce JAVA EE applications and components
Options:
1, System Administrator
2, Application Component Provider
3, Application Assembler
4, Tools Provider
Answer: 2
Marks: 1
=============================================================
SNo: 22
Ques: Which of the following options is a server-side client resource
Options:
1, Database tier
2, MDB
3, Entity bean
4, Session bean
Answer: 4
Marks: 1
=============================================================
SNo: 23
Ques: Which of the following options is used to obtain security information of the EJB objects
Options:
1, EJBObject
2, SessionContext
3, Context
4, @Resource
Answer: 2
Marks: 1
=============================================================
SNo: 24
Ques: Which of the following access modifier cannot be applied to a callback method
Options:
1, transient
2, protected
3, public
4, private
Answer: 1
Marks: 1
=============================================================
SNo: 25
Ques: Which of the following options assigns the name of the entity class as the default name to the database table
Options:
1, Java Persistence API
2, @Table annotation
3, LOB annotation
4, Basic annotation
Answer: 1
Marks: 1
0 Comments