0% found this document useful (0 votes)
9 views

Question Bank For Class Test-2

Uploaded by

Sanket Karade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Question Bank For Class Test-2

Uploaded by

Sanket Karade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1) IPv6 uses ________.

(a) 4 groups 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)
2) Name the class which is used to create a port where the server will listen
(a) Server (b) Socket
(c) ServerSocket (d) SocketServer
3) Communication using TCP protocol is ______ and ________.
(a) Connection less, Iterative (b) Collection less, concurrent
(c) Connection oriented, Iterative (d) Connection oriented, concurrent
4) Select full form of DNS.
(a) Data Network System (b) Domain Name System
(c) Domain Name Server (d) Domain Naming Service
5) Which of these is a bundle of information passed between machines?
(a) MIME (b) Cache (c) Datagram (d) Socket
6) Which from the below use “Middle tier”.
(a) 3 tier (b) 4 tier (c) n – tier (d) all of the above
7) Port number for FTP is _______
(a) 21 (b) 23 (c) 25 (d) 80
8) java.net package consists of interface __________
(a) ContentHandlerFactory (b) SocketImplFactory
(c) FileNameMap and URLStreamHandlerFactory (d) All of the above
9)________ is necessary to implement Datagram .
(a) DatagramPacket (b) DatagramSocket
(c) Both A & B (d) None of A & B
10) Which IP address is multicast IP address?
(a) 192.168.2.32 (b) 235.55.45.2
(c) 12.22.1.2 (d) None of these
11) A server socket can connect to ________ clients.
(a) 1 (b) 2
(c) 10 (d) multiple
12) Which class defines following methods?
int getContentLength( ), long getDate( ), long getExpiration( )
(a) URLConnection (b) Datagram
(c) Client (d) None of these
13) class Permission in java.security package is__________.
(a) static (b) abstract
(c) final (d) None of these
14) 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) java.sql
15) 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

16) Database programming using Java throws which of the following exception?
(a) SQLException (b) ClassNotFoundException
(c) None of these (d) Both of these
17) _____________ is a table of data which represents a data from table.
(a) MetaData (b) ResultSetMetaData
(c) ResultSet (d) Statement

18) Public class DriverManager extends ____________


(a) Object (b) String
(c) Connection (d) Statement
19) 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
20) Which of the following method is supported by Statement interface?
(a) public boolean execute(String query) (b) public ResultSet executeQuery(String query)
(c) public int executeUpdate(String query) (d) All of above
21) Which is main component of JDBC API?
(a) DriverManager (b) Driver
(c) Connection (d) All of these
22) How many steps are used to connect any java application with the database using JDBC ?
(a) 5 (b) 4
(c) 3 (d) 6
23) Native API converts ______ into the ______ used by DBMS.
(a) JDBC API, Network Protocol (b) JDBC API, Native API calls
(c) JDBC API, use calls (d) JDBC API, ODBC API calls
24) Which class/interface is used for an SQL statement that is executed frequently?
(a) Statement (b) CallableStatement
(c) PreparedStatement (d) None of the above
25) The JDBC‐ODBC bridge supports how many concurrent open statements per connection ?
(a) 1 (b) 0
(c) Does not support connection (d) None of these
26) Microsoft Access data in _______ file format.
(a) .DAT (b) .MDB
(c) .MSSQL (d) .OBJ
27) Which method executes an SQL statement that may return multiple results?
(a) executeUpdate( ) (b) executeQuery( )
(c) execute( ) (d) noExecute( )
28) The interface to the database is handle by _____ .
(a) ODBC (b) JDBC (c) JDBC & ODBC (d) APIs
29) DELETE statement of an SQL is executed by________. .
(a) execute( ) (b) executeQuery( )
(c) executeUpdate( ) (d) executeDelete( )
30) DatabaseMetadata are retrieved through___________
(a) getDatabaseMetadata( ) (b) getMetaData( )
(c) getDBMetaData( ) (d) getDatabaseMeta( )
31) Which of the following is used generally for reading the content of the database?
(a) DabaseData (b) DabaseData
(c) ResultSet (d) DatabaseResult
32) 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

33) JSP embeds __________ in ___________.


(a) Servlet, HTML (b) HTML, Java
(c) HTML, Servlet (d) Java, HTML
34) Which JSP tag is used to transfer for processing another JSP page?
(a) <jsp:include> (b) <jsp:forward>
(c) <jsp:useBean> (d) <jsp:use:include>

35) Which of the following is the default HttpRequest method?


(a) doGet( ) (b) doPost( )
(c) doTrace( ) (d) doPut( )
36) Which are true about tag libraries in web application?
(a) packaged in the /WEB‐INF directory or subdirectory of the WAR file
(b) If a tag is implemented as a tag file and packaged in /WEB‐INF/tags/ or a subdirectory, a TLD will be generated
automatically by the web container, though,you can provide one if you wish
(c) packaged in the /META‐INF/ directory or subdirectory of a tag library packaged in a jar.
(d) All of the above.

37) Name the http method used to send resources to the server.
(a) FTP method (b) PUT method
(c) WRITE method (d) COPY method

38) The include( ) method in RequestDispatcher ____.


(a) sends a request to another resource like servlet, JSP or html.
(b) includes resources of file like servlet, JSP or html.
(c) appends the request and response objects to the current servlet. (d) None of these
39) _________ is the first Phase of Servlet Life cycle.

(a) service( ) (b) init( ) (c) destroy( ) (d) Both B & C

40) ________ is a small piece of information that is passed back & forth in HTTP request & response.
(a) Servlet (b) Applet
(c) Cookie (d) Session
41) Which method is used to specify before any lines that used the PrintWriter?
(a) setPageType( ) (b) setContextType( )
(c) setContentType( ) (d) setResponseType( )
42) A user types the URL http://www.msbte.com/result.php. Which request gets generated?
(a) GET method (b) POST method
(c) HEAD method (d) PUT method
44) The following methods belongs to the life cycle methods of the servlet.
(a) init( ) (b) service( ) (c) destroy( ) (d) All of the above
45) Apache Tomcat is ________.
(a) Servlet (b) Java Program
(c) API (d) Web server capable of running Java programs
46) Servlet lifecycle has _________ states.
(a) Two (b) Three (c) Four (d) Five
47) How to send data in get method?
(a) using GET method in request (b) using Requesting URL
(c) using Response URL (d) using URL
48 What is the limit of data to be passed from HTML to doGet() ?
(a) 8kb (b) 1kb (c) 4kb (d) 2kb
49) The major difference between Servlet and CGI is _______.
(a) Servlets are thread based and CGI is process based.
(b) Servlet executes slower than CGI.
(c) Servlet has no platform specific API where as CGI has.
(d) All of these

50) The authentication mechanism in the servlet specification uses a technique called ?
(a) Role Based Authentication (b) Form Based Authentication
(c) Both a & b (d) None of the above

51) The major difference between Servlet and CGI is


_______.
(a) Servlets are thread based and CGI is process
based.
(b) Servlet executes slower than CGI.
(c) Servlet has no platform specific API where as
CGI has.
(d) All of these
52) JSP stands for _______.
(a) Java Service Provider
(b) Java Server Path
(c) Java Server Pages
(d) Java Server Program

53) JSP life cycle includes following


(a) Translation Phase
(b) Compilation Phase
(c) Request handling phase
(d) All of these

54) What the getSession( ) method with “true”


parameter will do?
(a) The session is completed
(b) The session object is passed to another
method
(c) Creates new session if, the session does not
exist
(d) The session is exist

55) State true or false for following statements.


(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

56) Identify the proper syntax of doGet( ).


(a) void doGet(HttpResponse res,HttpRequest
req) throws IOException, ServletException
(b) void doGet(HttpRequest req,HttpResponse
res) throws IOException, ServletException
(c) void doGet(HttpResponse res) throws
IOException, ServletException
(d) void doGet(HttpRequest req) throws
IOException, ServletException

57) Which are true about tag libraries in web


application?
(a) packaged in the /WEB‐INF directory or subdirectory
of the WAR file
(b) If a tag is implemented as a tag file and
packaged in /WEB‐INF/tags/ or a subdirectory,
a TLD will be generated
automatically by the web container, though,
you can provide one if you wish
(c) packaged in the /META‐INF/ directory or subdirectory
of a tag library packaged in a jar.
(d) All of the above.
58) An application wants to invalidate the session both
programmatically and declaratively. Select the
best match to do this.
(a) httpRequest.getSession( ).end( )
<session‐config><session‐timeout‐interval>
time_in_minutes </session‐timeout‐interval>
</session‐config>
(b) httpRequest.getSession( ).invalidate( )
<session‐config><session‐timeout>
time_in_minutes </session‐timeout>
</session‐config>
(c) httpRequest.getSession( ).close( )
<session‐config><session‐timeout>
time_in_minutes </session‐timeout>
</session‐config>
(d) httpRequest.getSession( ).invalidate( )
<session‐config> <session‐duration>
time_in_minutes </session‐duration>
</session‐config>

59) 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

60) Which kind of driver converts JDBC calls into calls


on the Client API for Oracle, Sybase, Informix, IBM
DB2, or other DBMS
(a) JDBC ODBC bridge + ODBC Driver
(b) Native API partly – Java Driver
(c) JDBC – Net pure Java Driver
(d) Native Protocol Pure Java Driver

You might also like