WTAD Sample Test Paper 3

WTAD Sample Test Paper 3

Q1. Answer the following. (Any 4) [5]
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) [09]
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. [12]
a. List out the <form> element attributes and <input> element “type” attributes. [04]
a. How will you create bullets and multiple options using <html> tag. [04]
b. Define servlet and explain the life cycle of servlet. [05]
c. Which method is more advantageous doGet() or doPost()? In which situation
does we use doGet()?[03]

Q4. Answer the following. [12]
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. [04]
b. Explain about PreparedStatement class. Give all method of it. [05]
c. What is the need of super.init(config) in servlets? Give suitable example. [03]
Q5. Answer the following. [12]
a. Write a program in JDBC using servlet to insert elements of 5 records from
the user.
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. [05]
c. What is the purpose of setAutoCommit( )? Explain with suitable example. [03]

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative