Olete.in
Articles
Mock Tests
🧪 JDBC MCQ Quiz Hub
JDBC Mcq Set 2
Choose a topic to test your knowledge and improve your JDBC skills
1. When destroy() method of a filter is called?
The destroy() method is called only once at the end of the life cycle of a filter
The destroy() method is called after the filter has executed doFilter method
The destroy() method is called only once at the begining of the life cycle of a filter
The destroyer() method is called after the filter has executed
2. Which of the following is true about servlets?
Servlets execute within the address space of web server
Servlets are platform-independent because they are written in java
Servlets can use the full functionality of the Java class libraries
Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries
3. How is the dynamic interception of requests and responses to transform the information done?
servlet container
servlet config
servlet context
servlet filter
4. Which are the session tracking techniques? i. URL rewriting ii. Using session object iii.Using response object iv. Using hidden fields v. Using cookies vi. Using servlet object
i, ii, iii, vi
i, ii, iv, v
i, vi, iii, v
i, ii, iii, v
5. Which page directive should be used in JSP to generate a PDF page?
contentType
generatePdf
typePDF
contentPDF
6. Which tag should be used to pass information from JSP to included JSP?
Using <%jsp:page> tag
Using <%jsp:param> tag
Using <%jsp:import> tag
Using <%jsp:useBean> tag
7. Application is instance of which class?
javax.servlet.Application
javax.servlet.HttpContext
javax.servlet.Context
javax.servlet.ServletContext
8. _jspService() method of HttpJspPage class should not be overridden.
True
False
all of the above
none of the above
9. Default value of autoFlush attribute is?
true
False
all of the above
none of the above
10. Which one is the correct order of phases in JSP life cycle?
Initialization, Cleanup, Compilation, Execution
Initialization, Compilation, Cleanup, Execution
Compilation, Initialization, Execution, Cleanup
Cleanup, Compilation, Initialization, Execution
11. “request” is instance of which one of the following classes?
Request
HttpRequest
HttpServletRequest
ServletRequest
12. Which is mandatory in <jsp:useBean /> tag?
id, class
id, type
type, property
type,id
13. Which one of the following is correct for directive in JSP?
&lt;%@directive%&gt;
&lt;%!directive%&gt;
&lt;%directive%&gt;
&lt;%=directive%&gt;
14. Which of the following action variable is used to include a file in JSP?
jsp:setProperty
jsp:getProperty
jsp:include
jsp:plugin
15. Which attribute uniquely identification element?
ID
Class
Name
Scope
16. “out” is implicit object of which class?
javax.servlet.jsp.PrintWriter
javax.servlet.jsp.SessionWriter
javax.servlet.jsp.SessionPrinter
javax.servlet.jsp.JspWriter
17. Which object stores references to the request and response objects?
sessionContext
pageContext
HttpSession
sessionAttribute
18. What temporarily redirects response to the browser?
&lt;jsp:forward&gt;
&lt;%@directive%&gt;
response.sendRedirect(URL)
response.setRedirect(URL)
19. Which tag is used to set a value of a JavaBean?
&lt;c:set&gt;
&lt;c:param&gt;
&lt;c:choose&gt;
&lt;c:forward&gt;
20. Can <!–comment–> and <%–comment–%> be used alternatively in JSP?
True
False
all of the above
none of the above
21. Java code is embedded under which tag in JSP?
Declaration
Scriptlet
Expression
Comment
22. Which of the following is not a directive in JSP?
page directive
include directive
taglib directive
command directive
23. Which of the following is not an Enterprise Beans type?
Doubleton
Singleton
Stateful
Stateless
24. Which of the following is not true about Java beans?
Implements java.io.Serializable interface
Extends java.io.Serializable class
Provides no argument constructor
Provides setter and getter methods for its properties
25. Which of the following is correct error when loading JAR file with duplicate name?
java.io.NullPointerException
java.lang.ClassNotFound
java.lang.ClassFormatError
java.lang.DuplicateClassError
26. Java Beans are extremely secured?
True
False
all of the above
none of the above
27. Which of the following is not a feature of Beans?
Introspection
Events
Persistence
Serialization
28. What is the attribute of java bean to specify scope of bean to have single instance per Spring IOC?
prototype
singleton
request
sessionAttribute
29. Which attribute is used to specify initialization method?
init
init-method
initialization
initialization-method
30. Which attribute is used to specify destroy method?
destroy
destroy-method
destruction
destruction-method
31. How to specify autowiring by name?
@Qualifier
@Type
@Constructor
@Name
32. Servlet are used to program which component in a web application?
client
server
tomcat
applet
33. Which component can be used for sending messages from one application to another?
server
client
mq
webapp
34. How are java web applications packaged?
jar
war
zip
both jar and war
35. How can we connect to database in a web application?
oracle sql developer
toad
JDBC template
mysql
36. How can we take input text from user in HTML page?
input tag
inoutBufferedReader tag
meta tag
scanner tag
37. Which of the below is not a javascript framework for UI?
Vaadin
AngularJS
KendoUI
Springcore
38. Which of the below can be used to debug front end of a web application?
Junit
Fitnesse
Firebug
Mockito
39. What type of protocol is HTTP?
stateless
stateful
transfer protocol
information protocol
40. What does MIME stand for?
Multipurpose Internet Messaging Extension
Multipurpose Internet Mail Extension
Multipurpose Internet Media Extension
Multipurpose Internet Mass Extension
41. What is the storage capacity of single cookie?
2048 MB
2048 bytes
4095 bytes
4095 MB
42. Which of below is not a dependency management tool?
Ant
Maven
Gradle
Jenkins
43. Which of the following is not a maven goal?
clean
package
install
debug
44. Which file is used to define dependency in maven?
build.xml
pom.xml
dependency.xml
version.xml
45. Which file is used to specify the packaging cycle?
build.xml
pom.xml
dependency.xml
version.xml
46. Which environment variable is used to specify the path to maven?
JAVA_HOME
PATH
MAVEN_HOME
CLASSPATH
47. Which of the below is a source code management tool?
Jenkins
Maven
Git
Hudson
48. Can we run Junits as a part of Jenkins job?
True
False
all of the above
none of the above
49. Which command can be used to check maven version?
mvn -ver
maven -ver
maven -version
mvn -version
50. Which of the following is not true for Ant?
It is a tool box
It provides lifecycle management
It is procedural
It doesn’t have formal conventions
Submit