MODULE 4
1. What are the primary differences between HTTP GET and POST methods? List any five
use-case scenarios where POST is preferred over GET.
2. Explain how cookies work in servlets and JSP. Illustrate the lifecycle of a cookie and
how it is used for state management.
3. Write a servlet that handles both GET and POST requests to accept user login data and
respond accordingly.
4. Analyze how session tracking works in a web application. Compare session tracking
using cookies, hidden fields, and HttpSession objects.
5. Evaluate the use of cookies versus session objects in maintaining user state in web
applications. Which one is more secure and why?
6. Design a JSP page that reads a request string, parses input data, and dynamically displays
it on the web browser using JSP tags.
7. Describe the installation and setup process of Tomcat for deploying JSP applications.
What are the key configuration files used?
8. Create a JSP program that demonstrates the use of variables, control statements, and
loops to calculate and display the factorial of a number entered by the user.
9. Compare and analyze the use of scripting elements in JSP (<% %>, <%= %>, and <%! %>)
with respect to their scope and performance.
10. Create a mini web application using JSP and Servlets where the user can submit their
details and retrieve them using session objects in the next page.
Module 5
1. Define JDBC. What are the different types of JDBC drivers and how do they differ from
one another?
2. Explain the steps involved in the JDBC process to connect a Java application with a
database.
3. Differentiate between Statement, PreparedStatement, and CallableStatement with examples of
their use.
4. Write a Java program using JDBC to insert a record into a MySQL database table
5. Implement a JDBC-based solution that uses PreparedStatement to update records securely in
a database.
6. Analyze the importance of connection pooling in a JDBC application. How does it
enhance performance?
7. Given a scenario where a JDBC application fails to connect intermittently, analyze
possible causes and suggest diagnostic steps.
8. Evaluate the pros and cons of using PreparedStatement over Statement. Justify your answer
with security and performance perspectives.
9. Evaluate different transaction isolation levels available in JDBC. How do they impact
data consistency and performance?
10. Design a Java program that connects to a database and retrieves metadata about tables
and columns using JDBC.
11. Write a JDBC code snippet that demonstrates how to handle auto-generated keys after
inserting a record.
12. Explain the significance of ResultSet types: TYPE_FORWARD_ONLY,
TYPE_SCROLL_INSENSITIVE, and TYPE_SCROLL_SENSITIVE.
13. Analyze how RowSet differs from ResultSet. In what scenarios would using RowSet be
preferable?
14. Develop a JDBC application that reads student data from a database and displays it in
scrollable format using a ScrollableResultSet.
15. Create a Java JDBC application to perform transaction management involving
transferring funds between two accounts. Ensure rollback on error.