AJP - Question Bank
AJP - Question Bank
Question Bank
1 What is the purpose of the URL class in Java?
2 List out the important methods of HttpServletResponse.
3 What is JDBC driver? Explain its role and compare various JDBC drivers
4 What are the differences between a TCP socket and UDP socket? How are they
created in Java?
5 Demonstrate the use of ServletConfig and ServletContext
6 What is Session? Compare different session management techniques.
7 What is the use of PreparedStatement? How will you use it?
8 What is filter? How will you configure filter using deployment descriptor?
9 What is the use of CallableStatement? How will you use it?
10 What are the cookies? Demonstrate the use of cookies in servlet for session management.
11 Explain the use of RequestDispatcher in servlet.
12 Explain URL and URLConnection class with example
13 What is Deployment descriptor (web.xml) in servlet? Explain with code.
14 Write a TCP program in which client sends string from its standard input to the
server. The server reads the string, converts the string into upper case and sends
back to client
15 Write a client-server program using TCP/UDP sockets to echo the message send
by the client.
16 Explain Servlet Life Cycle with example and demonstrate every state in detail.
17 What is connection URL? How do you make a database connection? Explain
various ways to make the database connection using JDBC code snippets.
18 Write a Login servlet. Take input username and password from html file login.html and
authenticate the user. Write the web.xml.
19 Write a JDBC Program for Employee Management application in which Consider
Employee table with attributes Emp_ID, EmpName, Phone and Address, and
perform followings:
i) Insert multiple records using prepared statement.
ii) Display all the records in reverse order.
20 How do you get the IP address of a machine from its hostname?
21 Explain the usage of InetAddress class
22 Differentiate HTTP Get and Post methods
23 Discuss the use of execute(), executeUpdate() and executeQuery() methods
24 Compare Socket with ServerSocket.
25 Write a program in which client sends string from its standard input to the
server. The server reads the string, converts the string into upper case and
sends back to client. Use connection-oriented communication.