Msbte Ajp ct2
Msbte Ajp ct2
Enter Test Password and click on End Test Button End Test Time Ramaining
00 : 09 : 25
Total Answered Questions 62 Total Un-Answered Questions 0
Overview of Examination
Q
Question Status Edit
No
Which are passive controls that do not support any interaction with the user?
2 Answered C hange/Edit2
Which of the following constructor is used for creating frame window with the title
4 Answered C hange/Edit4
MutableTreeNode is extends__________________interface
7 Answered C hange/Edit7
________ classes in security implement message digest & Digital signatures and can
13 authenticate java classes & other objects Answered C hange/Edit13
Which of these methods is used to know when was the URL last modified?
16 Answered C hange/Edit16
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 1/9
10/12/2016 Online e-Exam Portal of MSBTE
Which request method is used to send the query string(name/value pairs ) in the URL
21 Answered C hange/Edit21
Who is responsible for creating request & response object for a web server?
22 Answered C hange/Edit22
26 Answered C hange/Edit26
27 Answered C hange/Edit27
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 2/9
10/12/2016 Online e-Exam Portal of MSBTE
C hange/Edit28
28 Answered
Which of the following is not one of the seven methods for handling window events?
29 Answered C hange/Edit29
Which method is used to get HttpSession object and it belongs to which object?
40 Answered C hange/Edit40
The following methods belongs to the life cycle methods of the servlet.
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 3/9
10/12/2016 Online e-Exam Portal of MSBTE
The following methods belongs to the life cycle methods of the servlet.
41 Answered C hange/Edit41
42 Answered C hange/Edit42
f.setVisible(true);
for (int i=min;i<=max;i++)
{
final int percent=i;
try
{
p1.update(percent);
java.lang.Thread.sleep(100);
}
catch(Exception e){ }
}
______________ displays a message that alerts the user and waits for the user to click the OK
}
button to close the dialog.
44 } Answered C hange/Edit44
46 Answered C hange/Edit46
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 4/9
10/12/2016 Online e-Exam Portal of MSBTE
import java.applet.Applet;
For the following code select the method that can be used to handle event
import java.awt.*;
import java.awt.event.*;
/*<applet code="scr" width=300 height=300></applet>*/
public class scr extends Applet implements AdjustmentListener
{
Scrollbar r,g,b;
public void init()
{
r=new Scrollbar(Scrollbar.HORIZONTAL,0,50,0,255);
g=new Scrollbar(Scrollbar.HORIZONTAL,0,50,0,255);
47 b=new Scrollbar(Scrollbar.HORIZONTAL,0,50,0,255); Answered C hange/Edit47
add(r);
add(g);
add(b);
r.addAdjustmentListener(this);
g.addAdjustmentListener(this);
b.addAdjustmentListener(this);
}
public void _______________________________________
{
C olor c=new C olor(r.getValue(),g.getValue(),b.getValue());
setBackground(c);
}}
49 Answered C hange/Edit49
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 5/9
10/12/2016 Online e-Exam Portal of MSBTE
import java.sql.*;
class cont {
public static void main(String args[]){
53 try { Answered C hange/Edit53
C lass.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);
System.out.println(“Drivers are properly loaded”);
String url=”jdbc:odbc:abc”;
C onnection con=DriverManager.getC onnection(url);
System.out.println(“C onnection to database created”);
con.close();
}
catch(SQLExcption e)
{
System.out.println(“SQL Error ”);
{
catch(Exception e)
{
System.out.println(“error”);
}
}
}
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 6/9
10/12/2016 Online e-Exam Portal of MSBTE
54 a) TYPE_FORWARD_ONLY: creates a nonscrollable result set, that is, one in which the cursor Answered C hange/Edit54
moves only forward
b) TYPE_SC ROLL_INSENSITIVE : a scrollable result set does not reflects changes that are made
to it while it is open
c) TYPE_SC ROLL_SENSITIVE: a scrollable result set reflects changes that are made to it while
it is open
d) none of these.
while(rs.next()){
System.out.println(rs.getString(1));
}
C onnection con=DriverManager.getC onnection(url);
}catch(Exception ee){System.out.println(ee);}
56 this command will create the following Answered C hange/Edit56
}}
57 Answered C hange/Edit57
C onsider the following program and select the code that should get added to get the following
output import java.sql.*;
class stud5
{
public static void main(String ar[])throws Exception
{
C lass.forName("sun.jdbc.odbc.JdbcOdbcDriver");
C onnection con=DriverManager.getC onnection("jdbc:odbc:studdsn");
Statement s1=con.createStatement();
ResultSet res;
System.out.println("Before insertion");
res=s1.executeQuery("select * from student");
while(res.next())
{
System.out.println("Namet"+res.getString(1)+" Roll_NOt"+res.getInt(2)+"
pert"+res.getInt(3));
}
PreparedStatement st=con.prepareStatement("insert into student values(?,?,?) ");
st.setString(1,"Sayali");
st.setInt(2,45);
st.setInt(3,70);
st.executeUpdate();
st.setString(1,"Katta");
st.setInt(2,43);
st.setInt(3,70);
st.executeUpdate();
System.out.println("After insertion");
res=s1.executeQuery("select * from student");
}
}
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 7/9
10/12/2016 Online e-Exam Portal of MSBTE
PrintWriter pw = response.getWriter();
pw.print("<B>");
Date date = (Date)hs.getAttribute("date");
if(date != null) {
pw.print("Last access: " + date + "<br>");
58 } Answered C hange/Edit58
date = new Date();
hs.setAttribute("date", date);
pw.println("C urrent date: " + date);
}
}
In following Java program fill statement showing ***.Select any one option fro given options
import javax.servlet.*;
import javax.servlet.http.*;
public class AddC ookieServlet extends HttpServlet
{
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throwsServletException, IOException
{
String data = request.getParameter("data");
C ookie cookie = new C ookie("My C ookie",data);
59 response.*********; Answered C hange/Edit59
response.setC ontentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<B>MyC ookie has been set to");
pw.println(data);
pw.close();
}
}
To store the cookie object which method is used and of which class/interface?
60 Answered C hange/Edit60
What is the missing statement in the following program to get the proper output
import java.io.*;
import java.util.*;
public class HelloWorld extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setC ontentType("text/html");
PrintWriter out = response.getWriter();
HttpSession hp=request.getSession(true);
Date create=new Date(hp.getC reationTime());
Date access=new Date(hp.getLastAccessedTime());
out.println("<h1><br>Session is created at "+create);
out.println("<h1><br>Last access time is "+access);
out.println("<h1><br>Session id is "+hp.getId());
}
}
61 Answered C hange/Edit61
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 8/9
10/12/2016 Online e-Exam Portal of MSBTE
Assume that you need to write a JSP page that adds numbers from one to ten and then print
the output.
http://118.139.176.197/~ss/examw16/exam_17625_12oct2016/userindex.php?q=startexamall 9/9