Professional Documents
Culture Documents
Adv Java Qbank Midsem
Adv Java Qbank Midsem
Adv Java Qbank Midsem
2. Give the use of URL class and also give the syntax of constructor of
URL class.
3. Explain the use of URLConnection class & show the use of its
methods with example.
4. Write a program to retrieve and display port number and host name of
an URL.
7. Explain the steps to be performed on client and server side to write the
client server program using UDP.
9. Write a client server program using TCP where client sends a number
and server checks whether that number is prime or not and responds
with appropriate message.
10.Write a server program that works as FTP server. The client sends a
file name and the server returns with contents of that file.
11.Write a client server program that works like a DNS, where server
maintains a table having pairs of hostname-IP address and delivers the
IP address of machine from a table whose hostname is sent by the
client.
JDBC
1 What is JDBC?
2 Describe a general JDBC Architecture.
6 What is a connection?
7 What is a statement?
8 What is a ResultSet?
22 How does JDBC handle the data types of Java and database?
23 What does setAutoCommit do?
31 Suppose the SELECT returns 1000 rows, then how to retrieve the first 100
rows, then go back and retrieve the next 100 rows?
34 What is a "dirty read"? Which isolation level prevents dirty read in JDBC,
connection class?
SERVLET
1. What is a servlet?
2. What are the advantages of Servlet over CGI?
3. What are common tasks performed by Web/Servlet Container?
4. What is different between web server and application server?
5. Explain the major tasks that can be performed by Servlets?
6. How a container handles a request for a servlet?
7. What are the phases of servlet life cycle?
8. What is ServletConfig object? Explain methods of ServletConfig object.
Explain how to configure ServletConfig object.
9. What is ServletContext object? Explain methods of ServletContext object.
Explain how to configure ServletContext object.
10. What is difference between ServletConfig and ServletContext?
11. What is the difference between GET and POST method?
12. Explain Request and Response Objects in servlet.
13. Explain different Http Request headers and Response headers.
14. Explain different Http Request header methods and Response header
methods.
15. What is difference between GenericServlet and HttpServlet?
16. Explain working of service() method of a servlet. How to read form data in
servlet?
17. What is deployment descriptor?
18. What is MIME Type?
19. What is difference between PrintWriter and ServletOutputStream?
20. How to add/set headers to response object in a servlet?
21. How to set auto page refresh in servlet?
22. What is Request Dispatcher? What is the difference between Request
dispatcher’s forward() and include() method?
23. What is difference between ServletResponse sendRedirect() and
RequestDispatcher forward() method? Explain with example.
24. Explain the way using which the inter-servlet communication is possible?
25. What is servlet attributes and their scope?
26. How do we call one servlet from another servlet?
27. How can we invoke another servlet in a different application?
28. What are the phases of servlet life cycle?
29. What is URL Encoding?
30. What are different methods of session management in servlets?
31. What is URL Rewriting?
32. How does Cookies work in Servlets?
33. What is the difference between encodeRedirectUrl and encodeURL?
34. Why do we have servlet filters?
35. Write a servlet to upload file on server.