Ch 15: Java Database Connectivity (JDBC)

73 Questions73 MCQs0 Short Questions0 Long Questions
๐ŸŽฏ Exam Practice Papers
SEMESTER PASS

CS311 - Introduction to Web Services Development Examination Practice

Timed practice exam simulation for CS311 - Introduction to Web Services Development.

๐Ÿ“˜ VU MID TERM EXAMLectures 1 to 22
โฑ๏ธ 60 Mins

Mid Term Examination

Covers syllabus of Lectures 1 to 22 with 30 high-yield MCQs in a timed exam environment.

๐Ÿ“30 MCQs
โฑ๏ธ60 Minutes
๐Ÿ“— VU FINAL TERM EXAMLectures 23 to 45
โฑ๏ธ 90 Mins

Final Term Examination

Comprehensive semester exam preparation with 45 MCQs covering Lectures 23 to 45 with complete course coverage.

๐Ÿ“45 MCQs
โฑ๏ธ90 Minutes
Showing 1 โ€“ 10 of 73 Questions
Page 1 of 8
Q1
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.1. Introduction to Java ServletsEasy๐Ÿ”โญ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which of the following outlines the correct sequence of lifecycle method executions managed by a servlet container when running a Java Servlet?
  1. A.`init() -> service() -> destroy()`
  2. B.`start() -> service() -> stop()`
  3. C.`init() -> execute() -> destroy()`
  4. D.`create() -> execute() -> remove()`
Q2
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.2. Core Servlet Methods (doGet, doPost, doHead, etc.)Medium๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The `service()` method of `HttpServlet` delegates incoming HTTP requests to protocol-specific handler methods. Which methods are invoked by the `service()` method as appropriate?
  1. A.Only `doGet` and `doPost` methods
  2. B.Any of the standard HTTP handlers: `doGet`, `doPost`, `doPut`, `doDelete`, `doHead`, `doOptions`, and `doTrace`
  3. C.Only `init()` and `destroy()` methods
  4. D.Only request routing methods like `forward()` and `include()`
Q3
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.1. Introduction to Java ServletsEasy๐Ÿ”โญ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which sequence correctly represents the complete lifecycle methods called in order by a web container when running a Java Servlet?
  1. A.service() -> init() -> destroy()
  2. B.init() -> service() -> destroy()
  3. C.init() -> doGet() -> doPost()
  4. D.load() -> service() -> destroy()
Q4
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.2. Core Servlet Methods (doGet, doPost, doHead, etc.)Easy๐Ÿ”โญ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which method is invoked by the web container to route and process incoming client requests in a Java Servlet?
  1. A.init()
  2. B.doGet()
  3. C.doPost()
  4. D.service()
Q5
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.10. Client-Side Redirection with sendRedirect()Easyโญ๐Ÿ’ก๐ŸŒŸ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In Java Servlet development, which method is used to perform a client-side redirection to an external URL, such as redirecting a client search request directly to 'https://www.google.co.in' with search parameters?
๐Ÿ’ป java Snippet
response.sendRedirect("https://www.google.co.in/#q=" + name);
  1. A.RequestDispatcher.forward()
  2. B.HttpServletResponse.sendRedirect()
  3. C.RequestDispatcher.include()
  4. D.HttpServletResponse.setStatus()
Q6
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.1. Introduction to Java ServletsEasy๐Ÿ”โญ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which sequence correctly represents the complete lifecycle paths followed by a Java Servlet from its creation to its destruction by the web container?
  1. A.service() -> init() -> destroy()
  2. B.init() -> service() -> destroy()
  3. C.init() -> doGet() -> destroy()
  4. D.load() -> service() -> doGet() -> unload()
Q7
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.2. Core Servlet Methods (doGet, doPost, doHead, etc.)Easy๐Ÿ”โญ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which lifecycle method does a servlet container invoke to process an incoming client request and write a dynamic response back to the client?
๐Ÿ’ป java Snippet
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException;
  1. A.The `init()` method
  2. B.The `service()` method
  3. C.The `destroy()` method
  4. D.The `doGet()` method
Q8
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.1. Introduction to Java ServletsEasy๐Ÿ”โญ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
A Java servlet's life cycle is defined as the entire process spanning from which initial phase to its final termination?
  1. A.From its compilation till its deployment
  2. B.From its instantiation till its service invocation
  3. C.From its creation till its destruction
  4. D.From its registration till its resource retrieval
Q9
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.9. javax.servlet.http.Cookie and Cookie-based State ManagementEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
How many primary types of cookies are supported in Java Servlets to maintain user state across stateless connections, and what are their names?
๐Ÿ’ป java Snippet
Cookie ck = new Cookie("user", "sonoo jaiswal");
  1. A.2 (Non-persistent cookies and Persistent cookies)
  2. B.3 (Session cookies, Request cookies, and Database cookies)
  3. C.4 (Cookies, HttpSession, URL Rewriting, and Hidden Form Fields)
  4. D.1 (Only standard Session cookies are supported)
Q10
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.2. Core Servlet Methods (doGet, doPost, doHead, etc.)Easy๐Ÿ”โญ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which specific method is invoked directly by the web container to route and process incoming client requests in a Java Servlet?
  1. A.init()
  2. B.doGet()
  3. C.service()
  4. D.doPost()