0% found this document useful (0 votes)
15 views4 pages

Session 2 Test Answers - SET A

Uploaded by

asmainamdar2006
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)
15 views4 pages

Session 2 Test Answers - SET A

Uploaded by

asmainamdar2006
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/ 4

JSPM’s

JAYAWANTRAO SAWANT POLYTECHNIC,


Handewadi Road, Hadapsar, Pune-28
Department of Information Technology
Academic Year 2024-25
Sessional Test-II
Subject: AJP Subject Code: 2251 7
Class: TYIF Time : 1 hr
Course & Code: IF5I Marks: 20
Instructions:
1) All questions are compulsory.
2) Illustrate your answers with neat sketches wherever necessary.
3) Figures to the right indicate full marks.
4) Assume suitable data if necessary
Q.No 1 Attempt the Following Questions. ANSWER CO Marks

Which of the following classes/interface allows you to establish


a connection to database:a)
1.
A)java.sql.Driver CO5 1
D
B)java.sql.DriverManagerc)
C) java.sql.connectiond)
D)All of the above

Following is the correct syntax for cookies


A)Cookie c=ne Cookie(“MyCookie”,data);
B) Cookie c=ne Cookie(MyCookie,data);
2. A CO6 1
C) cookie c=ne Cookie(“MyCookie”,data);
D) Cookie c=ne Cookie(data ,“MyCookie”,data);

Which one is the correct syntax for creating Statement ?


A)Statement stmt=connection.createStatements();
3. B) Statement stmt=connection.createStatement(); B CO5 1
C) Statement stmt=connection.preparedStatement();
D) Statement stmt=connection.prepairedStatement();

Native API convert -----into the ----used by DBMS


A)JDBC API Native API calls
4. B)JDBC API ,Network protocol B CO5 1
C)JDBC API ,user calls
D)JDBC API ,ODBC API calls
Which of the output of the following statement
URL url=new URL(“https://www.google.com”)
System.out.println(url.getHostName());
5. A)https D CO4 1
B)-1
C)null
D)www.google.com
------identifies a servlet to process a http get request
A)session
1
6. B)cookie C CO6
1
C)request
D)URL
Which method is used to set the minimum age of the cookie in
seconds
A)public void setmaxage(int sec);
7. B) public void setmaxage(String sec); C CO6 1
C)public void setMaxAge(int sec);
D) public void setMaxAge(String sec);

Methods of ResultSet throws -------Exception

A) SQLException
8. B) B)ClassnotfoundException C CO5 1
C) IOEXception
D) NullPointerexception

Which of the following driver require natice library file to be


installed and configured on client system
A)TYPE 1 driver
9 B CO5 1
B) TYPE 12driver
C) TYPE 3 driver
D) ) TYPE 4 driver
The constructor which the Text Event class defines.
a) TextEvent(Object source, int event_type)
b) textevent (Object source, int event_type)
c) textevent (object Source, float event_type)
d) textevent (Object source, string event_type)
The constructor which the Text Event class defines.
a) TextEvent(Object source, int event_type)
10 b) textevent (Object source, int event_type) C CO6 1
c) textevent (object Source, float event_type)
d) textevent (Object source, string event_type)
which of the following is not a constructor of Cookie
A)Cookie only
B)Cookie(String s)only
C)both A&B
D)none
Which of the following constructor use to create socket using
preexisting InetAddress object and port
A)Socket(String hostname,int port)
11 B)Socket(InetAddress ipAdd,int port) A CO4 1
C)socket(InetAddress ipAdd,int port)
D) Socket(int port,InetAddress ipAdd)

12 Import java.net.*; B CO4 1


Class networking
{
Public static void main(String args[])
{
InetAddress
obj1=InetAddress.getByName(“www.google.com”);
InetAddress
obj1=InetAddress.getByName(“www.google.com”);
Boolean x=obj1.equals(obj2);
System.out.pritnln(x);
}}
A)1
B)true
C)-1
D)false

Which of the following code is used to get names of


the attributes in servlet?
A - response.getAttributeNames()
13 B - request.getAttributeNames() B CO6 1
C - Header.getAttributeNames()
D - None of the above.

Which package contain methods and interfaces for networking


A)java.net
14 B)java.sql A CO5 1
C)java.io
D)java.awt
Port Number of http is
A)80
15 B)22 A CO4 1
C)23
D) 21
When service() method of servlet gets called?
A) - The service() method is called when the servlet is
first created.
B )- The service() method is called whenever the servlet
16 is invoked. C CO6 1
C)- Both of the above.
D)- None of the above.

Which of the following code is used to delete a HTTP


Session object in servlets?
A - session.invalidate()
17 B - response.deleteSession() C CO6 1
C - request.deleteSession()
D - None of the above.

How long is an IPv6 address?


A)32 bits
18 B CO4 1
B)128 bytes
C)64 bits
D)128 bits

19 What is the description of java.sql.Connection D CO5 1


A)This class provides the functionality necessary for
managing one or more database drivers.
B)This is an interface that abstracts the vendor specific
connection protocol
C) This class is used to discover properties required to
obtain the connection
D)This interface abstracts most of the interaction with the
database.
JDBC-ODBC Bridge can be availed by importing __________
package.

A) java.sql

20 B) sun.jdbc.odbcCOB B CO5 1

C) java.jdbcodbc

D) None of the above

Subject Teacher Module Coordinator


HOD

You might also like