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 51 โ€“ 60 of 73 Questions
Page 6 of 8
Q51
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.11. Hidden Form Fields for State ManagementEasy๐Ÿ”โญ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In real-world web applications, the Hidden Form Field state management technique is widely used in which of the following scenarios?
๐Ÿ’ป html Snippet
<input type="hidden" name="pageId" value="101">
  1. A.Managing the server-side file uploads
  2. B.Controlling the visibility of radio buttons on a page
  3. C.The comment form of a website to store unique page IDs
  4. D.Managing server-side session timeouts automatically
Q52
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.13. HttpSession for Session TrackingEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which method of the `HttpSession` interface is used to invalidate a session and unbind any objects bound to it?
๐Ÿ’ป java Snippet
HttpSession session = request.getSession(false);
if (session != null) {
    session.invalidate();
}
  1. A.`void cancel()`
  2. B.`void cancelSession()`
  3. C.`void invalidate()`
  4. D.`void invalidateSession()`
Q53
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.5. Writing, Compiling, and Deploying a ServletEasyโญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When creating a servlet directly by utilizing the core API contract, the `javax.servlet.Servlet` interface must be _________.
๐Ÿ’ป java Snippet
public class MyServlet implements Servlet {
    public void init(ServletConfig config) throws ServletException {}
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {}
    public void destroy() {}
    public ServletConfig getServletConfig() { return null; }
    public String getServletInfo() { return null; }
}
  1. A.Implemented
  2. B.Extended
  3. C.Initiated
  4. D.Destroyed
Q54
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.5. Writing, Compiling, and Deploying a ServletEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
According to the Java Servlet specifications, which of the following is NOT a valid method of creating a servlet in a web application?
  1. A.By inheriting the `GenericServlet` class
  2. B.By inheriting the `HttpServlet` class
  3. C.By implementing the `Servlet` interface
  4. D.By directly calling the `service()` method
Q55
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.9. javax.servlet.http.Cookie and Cookie-based State ManagementEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Fill in the blank: According to the Java Servlets specification, a cookie is standardly defined as a small piece of ________ that is persisted between multiple client requests.
๐Ÿ’ป java Snippet
Cookie ck = new Cookie("user", "sonoo jaiswal");
  1. A.knowledge
  2. B.data
  3. C.information
  4. D.wisdom
Q56
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.9. javax.servlet.http.Cookie and Cookie-based State ManagementEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The following Java Servlet code is standardly used to perform which of the operations on a cookie? ```java Cookie ck = new Cookie("user", "sonoo jaiswal"); response.addCookie(ck); ```
๐Ÿ’ป java Snippet
Cookie ck = new Cookie("user", "sonoo jaiswal");
response.addCookie(ck);
  1. A.delete
  2. B.update
  3. C.create
  4. D.create and delete
Q57
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.9. javax.servlet.http.Cookie and Cookie-based State ManagementEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which of the following refers to a kind of state-tracking information that is stored on the client side in web applications?
  1. A.servlet
  2. B.URL
  3. C.ping
  4. D.cookie
Q58
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.8. State Management and Session Tracking OverviewEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In state management using URL Rewriting, which of the following represents the correct standard format used to append and transmit parameter name-value pairs to the next resource?
๐Ÿ’ป html Snippet
url?name1=value1&name2=value2
  1. A.`url?name1=value1&name2=value2`
  2. B.`url;name1=value1;name2=value2`
  3. C.`url/name1=value1/name2=value2`
  4. D.`url#name1=value1#name2=value2`
Q59
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.12. ServletContext Interface and ConfigurationEasyโญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In Java Servlet development, what category of programmatic member does `public String getInitParameter(String name)` represent within the `ServletContext` and `ServletConfig` interfaces?
๐Ÿ’ป java Snippet
String dbUrl = getServletContext().getInitParameter("databaseURL");
  1. A.Object
  2. B.Parameter
  3. C.Method
  4. D.Class
Q60
โ“ MCQ๐Ÿ“˜ CS311๐Ÿ“‘ Lec 15๐Ÿท๏ธ 15.5. Writing, Compiling, and Deploying a ServletMediumโญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which of the following methods of creating a Java servlet represents the highest level of abstraction for protocol-specific handling?
๐Ÿ’ป java Snippet
public class MyServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // Abstracted HTTP request handling
    }
}
  1. A.By inheriting the GenericServlet class
  2. B.By inheriting the HttpServlet class
  3. C.By not implementing service(), doGet(), and doPost() methods
  4. D.By implementing the Servlet interface directly