Adv Java Qbank Midsem

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

Java Network Programming

1. What is Internet addressing? Give the purpose of InetAddress class.

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.

5. Illustrate the working of DatagramSocket, DatagramPacket, Socket


and ServerSocket class.
6. Explain the steps to be performed on client and server side to write the
client server program using TCP/IP.

7. Explain the steps to be performed on client and server side to write the
client server program using UDP.

8. Write a client server program using TCP where client sends 10


numbers and server responds with sum of all the 10 numbers.

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.

3 What are the common JDBC API components?

4 What is a JDBC DriverManager?

5 What is a JDBC Driver?

6 What is a connection?

7 What is a statement?

8 What is a ResultSet?

9 What are types of ResultSet?

10 What are the basic steps to create a JDBC application?

11 Explain types of JDBC driver.

12 When should each of the JDBC driver type be used?

13 Which type of JDBC driver is the fastest one?

14 Does the JDBC-ODBC Bridge support multiple concurrent open statements


per connection?

15 What are the standard isolation levels defined by JDBC?

16 What are the different types of JDBC Statements?

17 What is difference between statement and prepared statement?

18 How do you register a driver?There are 2 approaches for registering the


Driver.

19 What are the benefits of JDBC 4.0?

20 How can you view a result set?

21 How do you update a result set?

22 How does JDBC handle the data types of Java and database?
23 What does setAutoCommit do?

24 What is SavePoint? Give an example.

25 What is a Stored Procedure and how do you call it in JDBC?

26 What is a transaction?How will you insert multiple rows into a database in a


single transaction?

27 What is the difference between execute, executeQuery, executeUpdate?

28 Why do you have to close database connections in Java?

29 What is the use of blob, clob datatypes in JDBC?

30 What is Connection Pooling?How do you implement connection pooling?

31 Suppose the SELECT returns 1000 rows, then how to retrieve the first 100
rows, then go back and retrieve the next 100 rows?

32 What we set the attribute Concurrency in ResultSet?

33 What are the differences between setMaxRows(int) and SetFetchSize(int)?

34 What is a "dirty read"? Which isolation level prevents dirty read in JDBC,
connection class?

35 What is Metadata and why should you use it?

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.

You might also like