0% found this document useful (0 votes)
32 views3 pages

QB2 Ajp

Question bank ajp for ut

Uploaded by

sanskrutinile06
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)
32 views3 pages

QB2 Ajp

Question bank ajp for ut

Uploaded by

sanskrutinile06
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/ 3

Advance Java Programming Question Bank II

Q.1 )Which method is used to specify before any lines that used the PrintWriter?
A) setPageType( ) B) setContextType( ) C) setContentType( ) D) setResponseType( )
Q.2) Which methods are used to bind the objects on HttpSession instance andget the objects?
A) setAttribute B) getAttribute C) Both A & B D) None of the above
Q. 3)JSP life cycle includes number of phases.
A) Two B) Three c) Four d) Five
Q.4) What type of servlets use these methods doGet(), doPost(),doHead(), doDelete(),
doTrace()?
A) Generic Servlets B) HTTP Servlets C) All of the above D) None of the above
Q. 5) Apache Tomcat is .
(a) Servlet b) Java Program c) API d) Web server capable of running Java programs
Q.6) Which cookie it is valid for single session only and it is removed each time
when the user closes the browser?
A) Persistent cookie B) Non-persistent cookie C) All the above D) None of the above
Q.7) Which method is used to perform DML statements in JDBC?
A) execute() B) executeQuery() C) executeUpdate() D) executeResult()
Q. 8) To send binary output in the response, the following method of HttpServlet response many
be used to get the appropriate Writer/Stream object.
(a) getStream( ) (b) getOutputStream( ) (c) getBianaryStream( ) (d) getWriter( )
Q. 9) JSP embeds _______________in_____________ .
(a) Servlet, HTML (b) HTML, Java (c) HTML, Servlet (d) Java, HTML
Q.10) Which driver uses ODBC driver to connect to the database?
A) JDBC-ODBC bridge driver B) Native - API driver
C)Network Protocol driver D) Thin driver
Q.11) Which of these is a not a factory method of InetAddress class?
A) static InetAddress getLocalHost(
B) static InetAddress getByName(String hostname)
C) static InetAddress getAllName(String hostname)
D) static InetAddress[ ] getAllByName(String hostname)
Q.12) 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
Q. 13)Which method is used to retrieve the ResultSet created?
A) executeQuery( ) B) getResultSet( ) C) getResultSetResult( ) D) getResult( )
Q.14) What does the following code do : smt = con.createStatement( )
A) A PreparedStatement object is created to send SQL commands to database.
B) A Statement object is created to send SQL commands to database.
C) A CallableStatement is created to send SQL commands to database.
D) A Statement object is created to execute parameterized SQL commands.
Q.15) 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>
Q.16) In InetAddress class which method returns the host name of IP address?
A) public String getHostName() B) public String getHostAddress()
C) public String InetAddress getLocalHost() D) none
Q.17) Which action tags are used in JSP for developing web application with Java Bean?
A) jsp:useBean B) jsp:setProperty C) jsp:getProperty D) Both B & C
Q. 18) DELETE statement of an SQL is executed by .
A) execute( ) B) executeQuery( ) C) executeUpdate( ) D) executeDelete( )
Q.19) A JSP page consists of which tags?
A) HTML tags B) JSP tags C) Both A & B D) None of the above
Q.20) Which of these package contains classes and interfaces for networking?
A) Java.io B) Java.util C) Java.net D) Java.network
Q.21) Which driver is efficient and always preferable for using JDBC applications?
A) Type – 4 B) Type – 1 C) Type – 3 D) Type – 2
Q.22) Which class provides stream to read binary data such as image et(c) from the request
object?
A) ServletInputStream B) ServletOutputStream C) Both a & b D) None of the above
Q.23) JSP life cycle includes following :
A) Translation Phase B) Compilation Phase
C) Request handling phase D) All of these
Q. 24) In JDBC imports all Java classes that are concern with Database connectivity.
A) javax.sql B) java.mysql C) java.sql D) com.sql
Q.25) The constructor of URL can throw an exception called
A) MalformedUrlException B) UrlNotFoundException
C) UrlException D) UrlSourceNotFoundException
Q. 26) Which class defines following methods?
int getContentLength( )
long getDate( )
long getExpiration( )
A) URLConnection B) Datagram C) Client D) None of these
Q.27) Identify correct syntax of service() method of servlet class . .
A) void service(ServletRequestreq , ServletResponse res)
B) void service(ServletResponse res ServletRequestreq.)
C) void service(ServletRequestreq, ServletRequestreq)
D)service(ServletResponsereq, ServletResponse res)
Q.28) JDBC-ODBC bridge is __________
A) Multithreaded B)Single threaded C)Both of the above D) None of these
Q.29) JDBC stands for ____________
A) Java Database Connectivity B) Java Database Component
C) Java Database Control D) None of the above
Q. 30) UDP stands for
A) User Data Port B) User Datagram Protocol
C) Used Data Provider D) User Data Protocol

You might also like