Ad Java
Ad Java
Answers
1. It is persistent
2. Platform independent
3. It is multi threaded
**4. It is single threaded.
=====================================================================
2. Which method of the servlet is/are called several times in its life?
Answers
1. init()
**2. doPost()
3. destroy()
4. None of above
=====================================================================
3. Which object is used to forward the request processing from one servlet to
another?
Answers
1. ServeltContext
2. ServletConfig
**3. RequestDispatcher
4. ResponseDispatcher
=====================================================================
4. The method getWriter returns an object of type PrintWriter. This class has
println methods to generate output. Which of these classes define the getWriter
method?
Answers
1. HttpServletRequest
**2. HttpServletResponse
3. ServletConfig
4. ServletContext
=====================================================================
Answers
1. .dbm
**2. .hbm
3. .ora
4. .sql
=====================================================================
6. How can we get context init parameter and run some code before rest of the
application can service a client?
Answers
1. ServletContextAttributeListener
**2. ServletContextListener
3. HttpSessionListener
4. All of these
=====================================================================
7. Suppose you want to know each time request comes in, so that you can log it.
Which listener is appropriate for that?
Answers
1. ServletContextAttributeListener
**2. ServletContextListener
3. HttpSessionListener
4. All of these
=====================================================================
8. Suppose you want to know each time request comes in, so that you can log it.
Which listener is appropriate for that?
Answers
**1. ServletRequestListener
2. ServletRequestAttributeListener
3. ServletContextListener
4. HttpRequestListener
=====================================================================
Answers
1. HttpSession
2. ServletRequest
3. ServletContext
**4. All of these
=====================================================================
10. Which of the following are the valid scopes in JSP?
Answers
**1. request, page, context, application
2. response, page, session, application
3. request, page, session, global
4. request, page, session, application
=====================================================================
11. Which of the following method can be used to used to instantiate a method?
Answers
**1. static factory method
2. default-init method
3. destroy method
4. lazy-init method
=====================================================================
Answers
1. Prototype
2. session
3. Request
**4. Singleton
=====================================================================
13. Which Standard tag is used store data in the JavaBeans instance?
Answers
1. <jsp:useBean>
2. <jsp:setBean>
3. <jsp:set>
**4. <jsp:setProperty>
=====================================================================
14. Which driver converts JDBC calls directly into the vendor-specific database
protocol?
Answers
1. Native-API driver
2. Network Protocol driver
**3. Thin driver
4. None of the above
=====================================================================
15. Which interface provides methods to execute queries with the database?
Answers
1. Connection interface
**2. Statement interface
3. ResultSet interface
4. None of the above
=====================================================================
Answers
1. public void setInt()
2. public void setDouble()
**3. public ResultSet executeQuery()
4. public void setFloat()
=====================================================================
Answers
1. SQL variant to generate
2. DTD
3. JDBC connection
**4. All of the options
=====================================================================
Answers
1. Session
2. ConnectionProvider
3. Transaction
**4. SessionFactory
=====================================================================
Answers
**1. object state changes in order to synchronize the updated state with the
database
2. remove the dirty data from database.
3. check the data when insert into database.
4. None
=====================================================================
Answers
**1. many-to-one
2. many-one
3. ManyToOne
4. None of the above
=====================================================================
21. Which ways are used by the Log4j and Logback frameworks in hibernate framework
to support logging?
Answers
1. By log4j.xml file
2. By log4j.properties
**3. Both of above
4. None of the above
=====================================================================
Answers
1. Data creation
2. Data manipulation
3. Data access
**4. All mentioned above
=====================================================================
Answers
**1. getSession() method
2. getCurrent() method
3. getCurrentSession() method
4. None of the above
=====================================================================
Answers
1. Autowiring by property name.
2. Similar to byType, but type applies to constructor arguments.
**3. Default setting which means no autowiring and you should use explicit bean
reference for wiring.
4. Spring first tries to wire using autowire by constructor, if it does not
work,Spring tries to autowire by byType.
=====================================================================
Answers
1. Setter Based DI
2. Auto-wiring DI
**3. Both of the above
4. None of the above.
=====================================================================
Answers
**1. Attached
2. Detached
3. Persistent
4. Transient
=====================================================================
Answers
1. ClassPathXmlApplicationContext
2. AnnotationApplicationContext
3. WebApplicationContext
**4. WebPathXmlApplicationContext
=====================================================================
Answers
1. @Autowired
**2. @Controller
3. @PreDestroy
4. @Qualifier
=====================================================================
=====================================================================
Answers
1. Using shutdownHook()
2. Using shutdownHandler()
3. Using registerHook()
**4. Using registerShutdownHook()
=====================================================================
Answers
**1. The @Controller annotation indicates that a particular class serves the role
of a controller.
2. The @Controller annotation indicates how to control the transaction management.
3. The @Controller annotation indicates how to control the dependency injection.
4. The @Controller annotation indicates how to control the aspect programming.
=====================================================================
32. Which of the following is correct about messaging in RESTful web services?
Answers
1. A client sends a message in form of a HTTP Request and server responds in form
of a HTTP Response.
2. These messages contain message data and metadata i.e. information about message
itself.
**3. Both of the above
4. None of the above.
=====================================================================
33. Spring provides a factory that can export beans annotated with:-
Answers
1. javax.jws.WebService
2. javax.jws.WebServiceProvider
**3. all of the mentioned
4. none of the mentioned
=====================================================================
Answers
1. jaxws:end
**2. jaxws:endpoint
3. all of the mentioned
4. none of the mentioned
=====================================================================
Answers
1. DEFAULT
2. READ COMMITTED
3. READ UNCOMMITTED
**4. All of the mentioned
=====================================================================
36. Which of the following method can be used to used to instantiate a method?
Answers
**1. static factory method
2. default-init method
3. destroy method
4. lazy-init method
=====================================================================
37. Which method is used to save or update the state of the given instance from the
underlying database?
Answers
1. session.update()
2. session.keep()
**3. session.saveOrUpdate()
4. session.Load()
=====================================================================
Answers
1. A component
**2. An Object
3. A class
4. A container
=====================================================================
Answers
1. TransactionManager
**2. PlatformTransactionManager
3. PlatformManager
4. PlatformTransaction
=====================================================================
Answers
1. security:spring
2. security:intercept-security
3. security:intercept
**4. security:protect
=====================================================================
############## End ##############
=====================================================================