Anda di halaman 1dari 12

ROLL NO : ______________________

ENTIRE QUESTION PAPER IS DIVIDED INTO THREE SECTIONS WHERE IN CANDIDATE IS ASKED TO ATTEMPT
EVERY QUESTION. EACH QUESTION SHOULD BE ANSWERED BY MARKING THE CHOSEN ANSWER.
DURATION: 90 MINUTES
SECTION A
JSP ( 20 QUESTIONS 30 MINUTES )

Q1). Which one of the following JSP methods CANNOT be defined within a JSP page?
a)
b)
c)
d)
e)
Ans :

jspDestroy()
jspRestore()
_jspService()
jspInit()
_jspRemove()
jspResotre() and _jspRemove() .

Q2). Which one of the following interfaces is used within a Servlet to allow another Servlet to process all or part of a
request?
a)
b)
c)
d)
e)
Ans:

javax.servlet.http.HttpSession
javax.servlet.RequestDispatcher
javax.servlet.ServletContext
javax.servlet.ServletRequest
javax.servlet.ServletConfig
b] javax.servlet.RequestDispatcher

Q3). Which one of the following correctly nests one custom tag within another?
a)
b)
c)
d)
e)

<stock:ticker><stock:price></stock:ticker></stock:price>
<stock:ticker><jsp:param name="price"/></price></stock:ticker>
<stock:ticker></stock:ticker><stock:price/><stock:price/>
<stock:ticker><stock:price/></stock:ticker>
<stock:ticker><stock:price/></>

Ans:
C) <stock:ticker></stock:ticker><stock:price/><stock:price/>
Q4). A Web application is located in the directory /tomcat/webapps/stocks.
Referring to the scenario above, what is the location of the application's deployment descriptor file?
a)
b)
c)
d)
e)
Ans:

/tomcat/webapps/stocks/WEB-INF/conf
/tomcat/webapps/stocks
/tomcat/webapps/stocks/docs
/tomcat/webapps/stocks/conf
/tomcat/webapps/stocks/WEB-INF
e ) /tomcat/webapps/stocks/WEB-INF

Q5). Which one of the following choices describes elements that are all required in the taglib element of a web.xml file?
a)
b)
c)
d)
e)

<taglib-uri>, <taglib-location>
<url>, <location>, <handler>
<taglib-url>, <taglib-location>
<taglib-uri>, <taglib-location>, <tag-handler>
<uri>, <location>

Q6). Which JSP tag obtains a reference to an instance of a Java object defined within a given scope?
a)
b)
c)
d)
e)
Ans:

<jsp:plugin>
<jsp:forward>
<jsp:include>
<jsp:servlet>
<jsp:useBean>
e) <jsp:useBean>

Q7). Your Web application, analyzestocks, depends on a JAR file, db.jar, provided by an outside vendor.
Referring to the scenario above, where do you place db.jar?
a)
b)
c)
d)
e)
Ans :

analyzestocks/WEB-INF/lib
analyzestocks/WEB-INF
analyzestocks
analyzestocks/WEB-INF/classes
analyzestocks/classes/lib
e)

analyzestocks/classes/lib

Q8). Which one of the following is a valid attribute for a JSP page directive?
a)
b)
c)
d)
e)

buffering="none"
isThreadSafe="false"
importer="package.class"
extender="package.class"
caching="false"

Ans:
b)

isThreadSafe="false"

Q9). What tier in a 3-tier architecture is responsible for generating the user interface?
a)
b)
c)
d)
e)
Ans :

Enterprise
GUI
Application
Integration
Presentation
e) Presentation

Q10). Which interface in the java.sql package is used to access database stored procedures?
a)
b)
c)
d)
e)

CallableStatement
ProcedureStatement
Statement
StoredProcedure
PreparedStatement

Ans:
a)

CallableStatement

Q11). Which one of the following techniques allows multiple users to share a single database connection?
a)
b)
c)
d)
e)
Ans:

Have each user use the single DB username and password for connection to the database.
Have the database functions placed in a single bean and have all users connect to that bean.
Have each user connect to the database using his own username and password.
Have the database accept multiple connections on multiple ports.
Have all of the database functions reside in a .JAR file on each client machine.
b) Have the database functions placed in a single bean and have all users connect to that bean.

Q12). Which one of the following web.xml elements do you use to define an initialization parameter for your servlet?
a)
b)
c)

<initialization-param>
<param>
<servlet-param>

d)
e)

<init-parameter>
<init-param>

Ans:
e)

<init-param>

Q13). Which one of the following provides a reference to the "this" variable within a JSP page?
a)
b)
c)
d)
e)
Ans:

The getThisProperty() method


The getProperty() method
The getFocus() method
The implicit page object
The servlet outputstream object
d) The implicit page object

Q14). Which one of the following implicit objects is typically used to retain information about a user between JSP pages?
a)
b)
c)
d)
e)

page
config
response
application
session

Ans:
e) session
Q15). Which one of the following results in an error stating that a JavaBean was NOT found?
a)
b)
c)
d)
e)

Ans:

You
You
You
You
You

are trying to write a second response to the client browser.


have attempted to use the getProperty action before the useBean tag.
have set "lang=" incorrectly.
have not compiled your applet using the latest API.
have not defined the JavaBean classpath.

b)

You have attempted to use the getProperty action before the useBean tag.

Q16). What method do you override to initialize instance variables in a JSP declaration?
a)
b)
c)
d)
e)

init
service
start
HttpJsppage constructor
jspInit

Ans :
e) jspInit
Q17). Which class or interface do you use to retrieve the HttpSession object associated with the current user?
a)
b)
c)
d)
e)
Ans:

HttpServlet
ServletContext
HttpServletRequest
ServletConfig
HttpServletResponse
c) HttpServletRequest

Q18). What attribute of the page directive do you use to have uncaught run-time exceptions automatically forwarded to an
error processing page?
a)
b)
c)
d)
e)
Ans:

page.error()
Exception
javax.throwable
Respond
errorPage

e) errorPage
Q19). Why are Web Archive (WAR) files used?
a)
b)
c)
d)
e)

To offer an easy and standard way to deploy Web Applications


To optimize for better performance
To heavily compress for faster downloads
To offer an integrated solution for developer environments
To offer advanced security for Web Applications

Q20). When building a Web Archive (WAR) target for a Web Application, the class files for the application are placed in
which one of the following directories?
a)
b)
c)
d)
e)

/classes
/WEB-INF/classes
/WEB-INF/lib
/xml
/WEB-INF

SECTION B
JAVASCRIPT ( 20 QUESTIONS 30 MINUTES )

Q1). document.form[0].action = "cgi-bin/process.cgi";


What does the above code segment do?
a)
b)
c)
d)
e)
Ans:

It changes the first form's display within the browser.


It submits the first form.
It changes the order in which the forms are processed.
It changes the script that processes the first form's results.
It changes the first form's method of submitting.
c)

It changes the order in which the forms are processed.

Q2). What code always brings window "newWindow" to the front?


a)
b)
c)
d)
e)

newWindow.Visibility(top)
setPosition.newWindow.top
newWindow.position(top)
onFocus.newWindow.show
newWindow.focus()

Ans:
e)

newWindow.focus()

Q3). <script language=javaScript>


function surfto(form) {
var idx=form.s1.selectedIndex
if(form.s1.options[idx].value != 0)
location=form.s1.options[idx].value;

} </SCRIPT><FORM name="form1">
<SELECT name=s1 onChange="surfto(this.form)"
size=1>
<OPTION selected value=0>Choose One
<OPTION value=u2.htm>U2
<OPTION value=u3.htm>U3
<OPTION value=u4.htm>U4</SELECT>
</FORM>
Which one of the following does the above code create?
a)
b)
c)
d)
e)

Four hyperlinks
Four buttons, each loading a corresponding URL when clicked
Four check boxes and a button that loads the selected document when clicked
A pull-down menu and a button that loads the selected document when clicked
A pull-down menu with four choices that loads a selected when focus is removed

Ans:
e)

A pull-down menu with four choices that loads a selected when focus is removed

Q4). <FORM><INPUT TYPE=text name="first"


onChange="echo(this.form,this.name);">
<INPUT TYPE=text name="second"
onChange="echo(this.form,this.name);">
</FORM><SCRIPT language=javascript>
function echo(form,currentfield) {
if(currentfield == "first")
form.second.value=form.first.value;
else
form.first.value=form.second.value;
} </SCRIPT>
Function echo() above does which one of the following?
a)
b)
c)
d)
e)
Ans :

It copies the text from the second field to the first.


It swaps the text entered between fields.
It moves the text from the first field to the second.
It copies the text from the first field to the second.
It moves the text from the second field to the first.
c)

It moves the text from the first field to the second.

Q5). function submitIt(form) {


dn = -1;
for(j=0; j<form.DCT.length;j++) {
if(form.DCT[j].checked)
dn = j;
}
if(dn == -1) {
alert("You must make a choice");
return false;
}
return true;
}
What type of form element is validated above?
a)
b)
c)
d)
e)
Ans:

Text Field
Text area
Radio button
Pull-down menu
Multi-choice pull down button
d) Pull-down menu

Q6). var num=0;


while(num<10) {
num++;
}

How many times does the above "while" loop iterate?


a)
b)
c)
d)
e)

9
10
At least 9
At least 10
It is impossible to tell

Ans :
b) 10
Q7). total=0;
for(var j=0;j<10;j++) {
for(var i=0;i<3;i++) total++;
}
What is the value of "total" after execution of the code above?
a)
b)
c)
d)
e)

0
24
27
30
33

Ans:
d) 30
Q8). <SCRIPT LANGUAGE="JavaScript">
<!-function functionCall(f){
top.document.title = f.TestSelect.options[f.TestSelect.selectedIndex].value;
}
// -->
</SCRIPT>
<FORM>
<SELECT NAME="TestSelect" onChange="functionCall(this.form);">
<OPTION VALUE="This is option 1">Option 1</OPTION>
<OPTION VALUE="This is option 2">Option 2</OPTION>
<OPTION VALUE="This is option 3">Option 3</OPTION>
</SELECT>
</FORM>
What does the above script do in Internet Explorer?
a)
b)
c)
d)
e)
Ans:

It outputs the selected title to the document's window.


It changes the selected index to the value of the selected option.
It changes the title of the document in the current frame.
It changes the title of the document in all open browser windows
It changes the title of the top level document to the value of the selected option.
e)

It changes the title of the top level document to the value of the selected option.

Q9). Which one of the following code samples changes the method of TestForm to "GET"?
a)
b)
c)
d)
e)

document.TestForm.setMethod("GET");
document.TestForm.method = "GET";
document.TestForm.onsubmit = "GET";
document.TestForm.method("GET");
document.TestForm.onsubmit("GET");

Ans:
b)

document.TestForm.method = "GET";

Q10). <SCRIPT LANGUAGE="JavaScript">


<!-function goTo(url){
document.location.href = url;
}
// -->

</SCRIPT>
<FORM>
<INPUT TYPE="button" onClick="goTo('link1.html'); return true;">
<INPUT TYPE="button" onClick="goTo('link2.html'); return true;">
<INPUT TYPE="button" onClick="goTo('link3.html'); return true;">
<INPUT TYPE="button" onClick="goTo('link4.html'); return true;">
<INPUT TYPE="button" onClick="goTo('link5.html'); return true;">
</FORM>
What does the above code create?
a)
b)
c)
d)
e)

Five buttons, each loading a corresponding URL when clicked


A pull-down menu and a button that loads the selected document when clicked
Five checkboxes and a button that loads the selected document when clicked
Five radio buttons and a button that loads the selected document when clicked
Five hyperlinks

Ans:
a)

Five buttons, each loading a corresponding URL when clicked

Q11). <form name=f1>


<input type="text" name="a">
<input type="text" name="b">
</form>
Referring to the above code, what code initially places the cursor in text field "a"?
a)
<HEAD onLoad="this.document.f1.focus();">
b)
<BODY Select="document.f1.a.select();">
c)
<BODY onChange="this.document.f1.select();">
d)
<HEAD setFocus="document.f1.a.focus();">
e)
<BODY onLoad="this.document.f1.a.focus();">
Ans:

e)

<BODY onLoad="this.document.f1.a.focus();">

Q12). setTimeout("cycle()",3 * 3000);


How often is function cycle() called in the above code?
a)
b)
c)
d)
e)

3 milliseconds
3.003 seconds
3000 milliseconds
9 seconds
9000 seconds

Ans:
Q13). var sample="test";
var result=sample.big();
Referring to the above code, what is the value of "result" after execution?
a)
b)
c)
d)
e)

TEST
<BIG>test</BIG>
<BIG>TEST</BIG>
test
Unable to tellbig() is not defined

Ans:
e) Unable to tellbig() is not defined
Q14). <FORM>
<INPUT type=button name=Reload
value=Reload onClick="loadOver();">
</FORM><SCRIPT language=javascript>
function loadOver() {
code here
} </SCRIPT>

Referring to the above code, what statement inside function loadOver() causes button "Reload" to emulate the Refresh
button of a browser?
a)
b)
c)
d)
e)

parent.ctr.location="javascript:location.reload()"
self.counter.location="location.history(0)"
parent.history(0)
document.location.href = this
location.reload()

Ans)
e) location.reload()
Q15). What code removes every 'x' from String "S"?
a)

b)
c)
d)
e)

var SCopy = '';


for(var i = 0; i < S.length; i++)
if(S.charAt(i)!='x') {SCopy += S.charAt(i);
S = SCopy;
for(var i = 1; i < S.length; i++) {
if(S.char(i) == 'x') S += S.charAt(i); }
while(i=1;i<S.length; i++)
if(S[i] != 'x') S == S[i];
var myArray = S.clear('x'); S = myArray.join('');
dowhile(var i=1; i<S.length; ++i)
if(S[i] != 'x') S == S[i];

Q16). Which one of the following attributes CANNOT be removed when opening a new window?
a)
b)
c)
d)
e)
Ans:

Location Box
TitleBar
MenuBar
Status
ScrollBars
c) TitleBar

Q17). Which method is used to end a document's output stream?


a)
b)
c)
d)
e)

document.close()
window.end()
window.close()
window.close(window.document)
document.end()

Ans:
a)

document.close()

Q18). <a href="map.htm" onMouseOver="window.status='Click for help!';">Site Map</a>


Which one of the following is true of the above code?
a)
b)
c)
d)
e)
Ans:

It does nothing because the JavaScript language is not specified.


It opens a new status window with document text "Click for Help!"
It creates a hyperlink that says "Click for Help!"
It displays a help message in the status bar when mouse is over the hyperlink.
Most browsers will interpret this as a syntax error.
d) It displays a help message in the status bar when mouse is over the hyperlink.

Q19). var circumference;


var radius = 10;
Referring to the above code, what code calculates the circumference of a circle (2 * pi * radius)?
a)
b)
c)
d)
e)

circumference = 2 * (new Math().getPi()) * radius


circumference = 2* Math.getPi() * radius
circumference = Math.PI * Math.sqr(radius)
circumference = 2 * Math.PI * radius
circumference = 2 * (new Math().PI) * radius

Ans:

d) circumference = 2 * Math.PI * radius

Q20). txt = new String("Sample text.");


function textColor() {
return "<FONT color='" + this.color
+ "'>" + this + "</FONT>";
}
Using the code above, what code assigns a "color" property to all string objects defaulted "gray" and facilitates printing
colored text to a browser?
a)
b)
c)
d)
e)

String.color = "gray";
String.colored = textColor;
String.color = "gray"
String.prototype.color = "gray";
String.prototype.colored = textColor;
String.txt.color = "gray"
color.String = "gray"

SECTION C
ORACLE AND SQL-SERVER ( 20 QUESTIONS 30 MINUTES )

Q1). What is used by Oracle to control concurrent access to data?


a)
b)
c)
d)
e)
Ans:

locks
transaction manager
net 8
session manager
memory holes
a)

locks

Q2). Which of the following correctly describe the restrictions on the use of LONG columns (choose all that apply):
a)
LONG columns cannot appear in WHERE clauses
b)
A table can contain only one LONG column.
c)
LONG columns cannot be indexed.
d) You cannot create an object type with a LONG attribute.
Ans:

a)
b)

LONG columns cannot appear in WHERE clauses


A table can contain only one LONG column

Q3). To enable a UNIQUE constraint ______


a)
b)
c)
d)

This is hard to determine.


you must have the privileges necessary to create an index on the table.
you must have the privileges necessary to create a rollback segment on the table.
you must have the privileges necessary to create a schema on the table.

Q4). What PL/SQL statements ensure that all database changes brought about by SQL operations are either made
permanent or undone at the same time (choose all that apply):
a)
b)
c)
d)
e)

COMMIT
ROLLBACK
CANCEL
CONFIRM
None of the choices

Ans:
a) COMMIT
Q5). What can occur when multiple users try to access the same schema object (fill in the blank):

Please write in your answer in the form below


-----------------------------------------------------------Q6). The CHAR datatype specifies a variable-length character string.
a)
This is hard to determine
b)
False
c)
True
d) None of the choices
Ans:
b) False
Q7). PL/SQL has which types of subprograms (choose all that apply):
a)
b)
c)
d)
e)
f)

This is hard to determine


pointers
procedures
links
functions
packages

Ans:
c)

procedures

Q8). nvarchar2 has an upper limit of how many bytes (fill in the blank):
Please write in your answer in the form below
Ans:

with an upper limit of 4000 bytes

-----------------------------------------------------------Q9). What statement do you use to define a logical table based on one or more tables (fill in the blank):
Please write in your answer in the form below
Ans:

To define logical relations between the table we can go for Views the keyword we use for this is View
-----------------------------------------------------------------------------------------------------------------------------------------------

Q10). In PL/SQL, the EXIT-WHEN statement lets you:


a)
this statement is not valid
b)
complete a loop if further processing is impossible
c)
This is hard to determine.
d) complete a loop if further processing is desirable.
Ans:

d) complete a loop if further processing is desirable.

Q11). The SQL server that Michael manages crashed. The disk drives were not damaged but there was data that had not
been written to some databases. Which transactions will be rolled forward in each database when his SQL server starts
the automatic recovery process?
a)
All committed transactions that are in the transaction log between the last checkpoint and the failure
b)
All committed transactions that are in the transaction log
c)
All committed transactions that are in the transaction log between the last two checkpoints
d) All uncommitted transactions that are in the transaction log
Ans:

If Auto Commit is True then during the recovery the data will get recovered.

Q12). What functions are performed by the SQL Server Agents?


(Choose all that apply)
a)
b)
c)
d)
e)

Notification
Job execution
User security managment
Replication management
Alert management.

Q13). Exchange and SQL 7.0 are running on the same server. You notice the performance in exchange is degraded. The
Min server memory, Maximum server memory and set working area are set as they were automatically in the installation.
What do you do to free memory for exchange?
a)
b)
c)
d)
e)

Increase Min server memory


Set working area to 0
Set working area to 1
Increase memory allocated to the procedure cache option
Reduce Min server memory

Q14). You define full-text indexing on the ProductName column in the Products table. You then execute a full-text query
on the column. You specify a word that you know is present in the column, but the result set is empty. What is the most
likely cause?
a)
b)
c)
d)

The Microsoft Service is not running


The SQL ServerAgent Service is not running
The catalog is not populated
You did not create a unique SQL Server index on the ProductName column

Q15). You start SQL-Server with the -f option. Unfortunately now you can't establish a connection to your SQL-Server.
What should you do?
a)
b)
c)
d)
e)

Edit regsitry
Restore registry from backup
Rebuild master database
Reinstall SQL -Server
Run regrebuld.exe

Q16). You must create a database for a motorbike dealership. You need to track the new and used motorbike inventory.
Each manufacturer assigns a unique identification number to each bike. Each motorbike could be sold more than once by
the same person. Provincial laws prohibit the same motorbike from being sold more than once on the same day. You
create a customer table and assign each customer a unique ID and store their address and phone number. The
transaction table stores the customer ID, motorbike ID, date of sale, salesperson ID. Which column can you use together
with the motorbike id number to uniquely identify each transaction?
a)
b)
c)
d)
Ans:

Salesperson ID
Year of the motorbike
Model
Date of sale.
d) Date of Sale

Q17). Your company has 3 offices each of which is responsible for sales in their respective territory. Which of the following
actions should you take to ensure a successful merge replication among you three offices?
a)
b)
c)
d)

You must include all tables with primary keys that are referenced by the foreign keys in the replicated tables
Prior to merge replication, create a unique identifier column in each table that are to be included in the
publication
Do nothing, DTS will take care of it.
Prior to merge, you must create an index in the tables that are to be included in the publication.

Q18). You want to set up replication between two databases, so the financial data and the sales data will be the same.
You want the data to replicate at 1:00 a.m. every morning. You would like to completely remove all data from the financial
database each night and overwrite data from the sales database. Which database replication model would you choose?
a)
b)
c)
d)
e)

Transactional replication
DTC replication
Subscriber replication
Snap shot replication
Merge replication

Q19). What is the commonly fixed database role of a db_datawriter?


a)
b)
c)
d)

Add, change or delete data from all the tables


Assign statement and object permissions
Backup and restore databases
Read data from any table

Q20). How would you add a country field to your database to ensure that your Argentinean subsidiary does business only
with other Argentinean companies?
a)
CHECK constraint
b)
PRIMARY KEY constraint
c)
FOREIGN KEY constraint
d) DEFAULT constraint
Ans:

a)

CHECK constraint

Anda mungkin juga menyukai