WTAD Sample Test Paper 3
Q1. Answer the following. (Any 4) 
i. Which of following defines object to open a connection to the database?
A. Connection B. DriverManager C. Device Manager D. Statement
ii. Which of the following methods are needed for loading a database driver in
A. registerDriver() method B. Class.forName() C. getConnection() D.
Both A and B
iii. Which type of Statement can execute parameterized queries?
A. PreparedStatement B. ParameterizedStatement
C. ParameterizedStatement and CallableStatement
D.All kinds of Statements (i.e. which implement a sub interface of
iv. Which packages contain the JDBC classes?
A. java.jdbc and javax.jdbc B. java.jdbc and java.jdbc.sql
B. java.sql and javax.sql D. java.rdb and javax.rdb
v. The JDBC-ODBC bridge is
A. Three tiered B. Multithreaded C. Best for any platform D. All of the
Q2. Answer the following in a single line. (Any 5) 
a. How can you load the drivers in JDBC?
b. How can you retrieve data from the ResultSet?
c. List out different types of servlets available.
d. What is the advantage of using a PreparedStatement?
e. Which code line must be set before any of the lines that use the PrintWriter?
f. How many statements can be created with one connection?
g. What is the difference between ServletContext and ServletConfig?
h. Which is the best driver among the 4 JDBC drivers and How?
i. How will you get the resultset of stroedProcedure?
j. What are scriptlet, declaration and expression?
Q3. Answer the following. 
a. List out the <form> element attributes and <input> element “type” attributes. 
a. How will you create bullets and multiple options using <html> tag. 
b. Define servlet and explain the life cycle of servlet. 
c. Which method is more advantageous doGet() or doPost()? In which situation
does we use doGet()?
Q4. Answer the following. 
a. What are the different types of statements available in JDBC? Explain any
one with suitable example.
a. What is ServletRequest & ServletResponse? List 3 methods of each. 
b. Explain about PreparedStatement class. Give all method of it. 
c. What is the need of super.init(config) in servlets? Give suitable example. 
Q5. Answer the following. 
a. Write a program in JDBC using servlet to insert elements of 5 records from
a. Write a program in JDBC using JSP to insert elements of 5 records from the
b. List out implicit objects of JSP and give example each. 
c. What is the purpose of setAutoCommit( )? Explain with suitable example.