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:
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
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)
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 )
newWindow.Visibility(top)
setPosition.newWindow.top
newWindow.position(top)
onFocus.newWindow.show
newWindow.focus()
Ans:
e)
newWindow.focus()
} </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
Text Field
Text area
Radio button
Pull-down menu
Multi-choice pull down button
d) Pull-down menu
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 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";
</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)
Ans:
a)
e)
<BODY onLoad="this.document.f1.a.focus();">
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)
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
document.close()
window.end()
window.close()
window.close(window.document)
document.end()
Ans:
a)
document.close()
Ans:
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 )
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)
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):
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:
-----------------------------------------------------------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
-----------------------------------------------------------------------------------------------------------------------------------------------
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.
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)
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)
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
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