AJP-Test 2 Question Bank

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

AJP-Test 2 Question Bank

Q1) State true or false: _________


i) JavaBeans slow down software development process
ii) Java Servlets do not have built in Multithreaded feature
a) False,false b) false,true c)true,false d) true,true
Q2) Which life cycle method is used to process client’s request _________
a) start() b) init() c) service() d) destroy()
Q3) _______is used to read data from a client request
a) ServletResponse b)ServletRequest c) Servlet d) ServletConfig
Q4) JSP stands for ___________
a) Java Service Provider b)Java Server Path c) Java Server Pages d) Java Server Program
Q5) What is the limit of data to be passed from HTML to doGet() __________
a) 8KB b) 1KB c) 4KB d) 2KB
Q6) Which of the following is the default HttpRequest method ? _____________
a) doGet() b) doPost() c) doTrace() d) doPut()
Q7) Servlet Lifecycle has _______states
a) 2 b) 3 c) 4 d) 5
Q8) Which of the following is not a type of JDBC driver? __________
a) 100% pure java driver
b) b) JDBC- net pure java driver
c) c) JDBC- native API driver
d) JDBC – native pure java driver
Q9) What is purpose of next() method __________
a) To retain the next element in a series
b) To retain next table
c) To retain next record in a series
d) None of the above
Q10) The_______ package contains classes that help in connecting to a database, sending SQL
statements to the database and process the query request _______
a) Connection.sql b) Db.sql c) Pkg.sql d) javax.sql

Q11) ODBC minimum SQL grammar contains____


a) Stored procedure
b) Data,time and timestamp only
c) Create or drop view
d) Insert, update, delete only
Q12) The syntax to create a table named “Course” should begin with _________
a) create new table course
b) b) create table course
c) table course create
d) new table course
Q13) DELETE statement of SQL is executed by _______
a) execute() b) executeQuery() c) executeUpdate() d) executeDelete()
Q14) ________ is a table of data which represents a data from table
a) MetaData b) ResultSetMetaData c) ResultSet d) Statement
Q15) Communication using TCP protocol is _____ and _____
a) Connection less, iterative
b) Connection less, concurrent
c) Connection oriented, iterative
d) Connection oriented, concurrent
Q16) Which of these is a bundle of information passed between machines _________
a) MIME b) Cache c) Datagram d) Socket
Q17) Port number of FTP is _________
a) 21 b) 23 c) 25 d) 80
Q18) class Permission in java.security package is ___________
a) static b) abstract c) final d) None
Q19) IPv6 uses __________
a) 4 group of 8 bits each
b) 4 group of 8 hexa-decimal digits
c) 8 groups of 4 digits each
d) 8 groups of 4 hexa-decimal digits each
Q20) What value is returned by the readline() when it reaches at the End of File? _________
a) EOF b) NULL c) 0 d) END

****************************************************************

Q1) Communication using TCP protocol is _____ and _____


a) Connection less, iterative
b) Connection less, concurrent
c) Connection oriented, iterative
d) Connection oriented, concurrent
Q2) Which of these is a bundle of information passed between machines _________
a) MIME b) Cache c) Datagram d) Socket
Q3) Port number of FTP is _________
a) 21 b) 23 c) 25 d) 80
Q4) class Permission in java.security package is ___________
a) static b) abstract c) final d) None
Q5) IPv6 uses __________
a) 4 group of 8 bits each
b) 4 group of 8 hexa-decimal digits
c) 8 groups of 4 digits each
d) 8 groups of 4 hexa-decimal digits each
Q6) What value is returned by the readline() when it reaches at the End of File? _________
a) EOF b) NULL c) 0 d) END
Q7) State true or false: _________
i) JavaBeans slow down software development process
ii) Java Servlets do not have built in Multithreaded feature
a) False,false b) false,true c)true,false d) true,true
Q8) Which life cycle method is used to process client’s request _________
a) start() b) init() c) service() d) destroy()
Q9) _______is used to read data from a client request
a) ServletResponse b)ServletRequest c) Servlet d) ServletConfig
Q10) JSP stands for ___________
a) Java Service Provider b)Java Server Path c) Java Server Pages d) Java Server Program

Q11) What is the limit of data to be passed from HTML to doGet() __________
a) 8KB b) 1KB c) 4KB d) 2KB
Q12) Which of the following is the default HttpRequest method? _____________
a) doGet() b) doPost() c) doTrace() d) doPut()
Q13) Servlet Lifecycle has _______states
a) 2 b) 3 c) 4 d) 5
Q14) Which of the following is not a type of JDBC driver? __________
a) 100% pure java driver
e) b) JDBC- net pure java driver
b) c) JDBC- native API driver
c) JDBC – native pure java driver
Q15) What is purpose of next() method __________
a) To retain the next element in a series
e) To retain next table
b) To retain next record in a series
c) None of the above
Q16) The_______ package contains classes that help in connecting to a database, sending SQL
statements to the database and process the query request _______
a) Connection.sql b) Db.sql c) Pkg.sql d) javax.sql
Q17) ODBC minimum SQL grammar contains_______
a) Stored procedure
b) Data,time and timestamp only
c) Create or drop view
d) Insert, update, delete only
Q18) The syntax to create a table named “Course” should begin with _________
a) create new table course
b) b) create table course
c) table course create
d) new table course
Q19) DELETE statement of SQL is executed by _______
a) execute() b) executeQuery() c) executeUpdate() d) executeDelete()
Q20) ________ is a table of data which represents a data from table
a) MetaData b) ResultSetMetaData c) ResultSet d) Statement
Q1) Which of the following is not a type of JDBC driver? __________
a) 100% pure java driver
b) JDBC- net pure java driver
c) JDBC- native API driver
d) JDBC – native pure java driver
Q2) What is purpose of next() method __________
a) To retain the next element in a series
b) To retain next table
c) To retain next record in a series
d) None of the above
Q3) The_______ package contains classes that help in connecting to a database, sending SQL statements
to the database and process the query request _______
a) Connection.sql b) Db.sql c) Pkg.sql d) javax.sql
Q4) ODBC minimum SQL grammar contains________
a) Stored procedure
b) Data,time and timestamp only
c) Create or drop view
d) Insert, update, delete only
Q5) The syntax to create a table named “Course” should begin with _________
a) create new table course
b) create table course
c) table course create
d)new table course
Q6) DELETE statement of SQL is executed by _______
a) execute() b) executeQuery() c) executeUpdate() d) executeDelete()
Q7) ________ is a table of data which represents a data from table
a) MetaData b) ResultSetMetaData c) ResultSet d) Statement

Q8) Communication using TCP protocol is _____ and _____


a) Connection less, iterative
b) Connection less, concurrent
c) Connection oriented, iterative
d) Connection oriented, concurrent
Q9) Which of these is a bundle of information passed between machines _________
a) MIME b) Cache c) Datagram d) Socket
Q10) Port number of FTP is _________
a) 21 b) 23 c) 25 d) 80
Q11) class Permission in java.security package is ___________
a) static b) abstract c) final d) None
Q12) IPv6 uses __________
a) 4 group of 8 bits each
b) 4 group of 8 hexa-decimal digits
c) 8 groups of 4 digits each
d) 8 groups of 4 hexa-decimal digits each
Q13) What value is returned by the readline() when it reaches at the End of File? _________
a) EOF b) NULL c) 0 d) END
Q14) State true or false: _________
i) JavaBeans slow down software development process
ii) Java Servlets do not have built in Multithreaded feature
a) False,false b) false,true c)true,false d) true,true
Q15) Which life cycle method is used to process client’s request _________
a) start() b) init() c) service() d) destroy()
Q16) _______is used to read data from a client request
a) ServletResponse b)ServletRequest c) Servlet d) ServletConfig
Q17) JSP stands for ___________
a) Java Service Provider b)Java Server Path c) Java Server Pages d) Java Server Program
Q18) What is the limit of data to be passed from HTML to doGet() __________
a) 8KB b) 1KB c) 4KB d) 2KB
Q19) Which of the following is the default HttpRequest method ? _____________
a) doGet() b) doPost() c) doTrace() d) doPut()
Q20) Servlet Lifecycle has _______states
a) 2 b) 3 c) 4 d) 5

*****************************************************
Q1) What is the limit of data to be passed from HTML to doGet() __________
a) 8KB b) 1KB c) 4KB d) 2KB
Q2) Which of the following is the default HttpRequest method ? _____________
a) doGet() b) doPost() c) doTrace() d) doPut()
Q3) Servlet Lifecycle has _______states
a) 2 b) 3 c) 4 d) 5
Q4) Which of the following is not a type of JDBC driver? __________
a) 100% pure java driver
b) JDBC- net pure java driver
c) JDBC- native API driver
d) JDBC – native pure java driver
Q5) What is purpose of next() method __________
a) To retain the next element in a series
b) To retain next table
c) To retain next record in a series
d) None of the above
Q6) The_______ package contains classes that help in connecting to a database, sending SQL statements
to the database and process the query request _______
a) Connection.sql b) Db.sql c) Pkg.sql d) javax.sql
Q7) Which life cycle method is used to process client’s request _________
a) start() b) init() c) service() d) destroy()
Q8) _______is used to read data from a client request
a) ServletResponse b)ServletRequest c) Servlet d) ServletConfig
Q9) JSP stands for ___________
a) Java Service Provider b)Java Server Path c) Java Server Pages d) Java Server Program

Q10) ODBC minimum SQL grammar contains________


a) Stored procedure
b) Data,time and timestamp only
c) Create or drop view
d) Insert, update, delete only
Q11) The syntax to create a table named “Course” should begin with _________
a) create new table course
b) create table course
c) table course create
d)new table course
Q12) DELETE statement of SQL is executed by _______
a) execute() b) executeQuery() c) executeUpdate() d) executeDelete()
Q13) ________ is a table of data which represents a data from table
a) MetaData b) ResultSetMetaData c) ResultSet d) Statement
Q14) Port number of FTP is _________
a) 21 b) 23 c) 25 d) 80
Q15) class Permission in java.security package is ___________
a) static b) abstract c) final d) None
Q16) IPv6 uses __________
a) 4 group of 8 bits each
b) 4 group of 8 hexa-decimal digits
c) 8 groups of 4 digits each
d) 8 groups of 4 hexa-decimal digits each
Q17) What value is returned by the readline() when it reaches at the End of File? _________
a) EOF b) NULL c) 0 d) END
Q18) State true or false: _________
i) JavaBeans slow down software development process
ii) Java Servlets do not have built in Multithreaded feature
a) False,false b) false,true c)true,false d) true,true
Q19) Communication using TCP protocol is _____ and _____
a) Connection less, iterative
b) Connection less, concurrent
c) Connection oriented, iterative
d) Connection oriented, concurrent
Q20) Which of these is a bundle of information passed between machines _________
a) MIME b) Cache c) Datagram d) Socket
Q) Port number 21 & 80 is for ____
a) Telnet,e-mail b) FTP,HTTP c) Finger,Telnet d) TCP,UDP
Q) _____is abstract class for representing access to a system resource
a) Security b) Permission c) Policy d) None of the above
Q) If port number is not specified in the URL, getPort() returns_____
a) 1 b)-2 c) 0 d) blank

Q) Which Exception is thrown by Datagram socket constructor ?


a) DatagramSocketException
b) SocketException
c) Malformed URLException
d) URLException

1. Which of the following classes/interface allows you to establish a


connection to database:
a) java.sql.Driver
b) java.sql.DriverManager
c) java.sql.connection
d) All of the above

2. Which of the following is JDBC version was released with Java EE 6


a) JDBC 2.0
b) JDBC 3.0
c) JDBC 4.0
d) JDBC 4.1

3. OCI stands for _____________


a) Order Command Interface
b) Oracle Call Interface
c) Operation Command Interface
d) Open Command Interface

4. ............................. implementation are provided by the driver


vendor.
a) DataSource
b) DataManager
c) DriverManager.
d) None

5. We can execute the precompiled SQL statements by using


a) execute()
b) executeUpdate()
c) executeQuery()
d) all of the above

6. javax.sql package is also called as ______.


a) JDBC extension API
b) API
c) JDBC extension
d) none of the above

7. How many times the query is compiled when used


PreparedStatement?
a) once
b) twice
c) thrice
d) quadriple

8. The ...................... method executes a simple query and returns a


singleResult Set object.
a) executeUpdate()
b) executeQuery()
c) execute()
d) noexecute()

9. The ................... method executes an SQL statement that may


return multiple results.
a) executeUpdate()
b) executeQuery()
c) execute()
d) noexecute()

10. The .................... object allows you to execute parametrized


queries.
a) ResultSet
b) Parametrized
c) PreparedStatement
d) Condition

11. The .................. object provides you with methods to access


data from the table.
a) ResultSet
b) Parametrized
c) TableStatement
d) Condition
12. Three methods are central to the life cycle of a servlet _____,
_____ and ______ .
a) init(), main(), run()
b) init(), service(), destroy()
c) init(), run(), stop()
d) init(), start(), stop()

13. DELETE statement of an SQL is executed by ______________.


a) executeUpdate()
b) executeQuery()
c) Execute()
d) executeStatement()

14. forName is a_________ type method


a) Static
b) Dynamic

15. getConnection() method of which class


a) DriverManager
b) Statement
c) Connection
d) None of above

16. How many JDBC driver types are available by sun Microsystem?
a) 6
b) 4
c) 5
d) 3

17. The PreparedStatement________symbol is placeholder that is


replaced by the input parameter at seen time.
a) ?
b) *
c) &
d) #

18. Where the object of ResultSet maintains a cursor?


a) Second Row
b) First Row
c) Last Row
d) Middle Row
19. Which interface provides methods to execute queries with the
database?
a) Statement interface
b) Connection
c) Resultset
d) DriverManager

20. Which JDBC driver Types are used for over communications
networks?
a) Type 2
b) Type 3
c) Type 4
d) Both Type 3 and Type 4
1.In the _______ method of servlet connection is created.
a) destroy()
b) service()
c) init()
d) connect()

2. A servlet is an instance of ___________


a) HTTPServlet class
b) Cookie
c) HttpSessionBindingEvent
d) HttpUtils

3. To work with servlet ______________ is required


a) Java Development Kit
b) Java Server Kit
c) Java Server Development Kit
d) Java Servlet Development

4. Which method is called to process HTTP request?


a) destroy()
b) service()
c) init()
d) none of these

5.The server calls ________ method to relinquish any resources, such


as files handles that are allocated for servlet.
a) service()
b) init()
c) destroy()
d) stop()

6. The life cycle of servlet is managed by _________


a) servlet context
b) servlet container
c) supporting protocol(http or https)
d) all of the above

7. Servlet creates ______ thread for each request of client.


a) single
b) two
c) multiple
d) None of These
8. Which package contains the classes and interfaces required to
build servlet?
a) import javax.servlet.*;
b) import javax.servlet.http.*;
c) both a&b
d) None of these

9. The ______ class provides functionality that makes it easy to


handle requests and responses.
a) Generic Servlet
b) ServletInputStream
c) ServletOutputStream
d) None of these

10. The call to setContentType() establishes the MIME type of the


HTTP response.
a) True
b) False

11. servletrunner utility tool listens on ______ port for incoming client
requests.
a) 80
b) 21
c) 53
d) 8080

12. Which of the following interface declares the lifecycle method


for servlet.
a) Servlet
b) Servlet Config
c) ServletContext
d) ServletResponse

13. _________ interface is used to read data from a client request.


a) ServletResponse
b) ServletRequest
c) both a&b
d) None of these

14. ________ is responsible for managing execution of servlet


a) Web Container
b) Servlet Context
c) JVM
d) Server

15. GenericServlet class implements _____ and _______ interfaces.


a) ServletRequest and ServletResponse
b) ServletResponse and Servlet
c) Servlet and ServletConfig
d) None of these

16. Which of the following class provides an input stream for


reading requests from a client
a) ServletException
b) GenericServlet
c) ServletOutputStream
d) ServletInputStream

17. Which of the following class provides an output stream for


writing response to the client
a) ServletException
b) GenericServlet
c) ServletOutputStream
d) ServletInputStream

18. ________ class indicates that a servlet error occurred.


a) ServletException
b) Unavailable Exception
c) GenericServlet
d) None of these

19. Which of the following interface allows a servlet to obtain


configuration data when it is loaded
a) ServletConfig
b) ServletContext
c) ServletRequest
d) None of these

You might also like