0% found this document useful (0 votes)
103 views18 pages

Test

HttpSession session = request.getSession(true); This statement can be placed at line 23 to retrieve an existing HttpSession object or create a new one if it does not already exist. Calling request.getSession() with true passed as a parameter will return the current session if it exists or create a new one if it does not.

Uploaded by

Deepa Suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views18 pages

Test

HttpSession session = request.getSession(true); This statement can be placed at line 23 to retrieve an existing HttpSession object or create a new one if it does not already exist. Calling request.getSession() with true passed as a parameter will return the current session if it exists or create a new one if it does not.

Uploaded by

Deepa Suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 18

QuestionText Choice1 Choice2

By setting
the
session-
timeout
paramete
By using r in the
the web.xml
Carefully read the question and answer accordingly. invalidate file to 1
Which of the following options can be used by the controller to destroy a session of a web application
() method minute
immediately?

Carefully read the question and answer accordingly. HttpSessi HttpSessi


Given an HttpServletRequest request: on on
22. String id = request.getParameter("jsessionid"); session = session =
23. // insert code here request.g request.g
24. String name = (String) session.getAttribute("name"); etSession etSession
Which statement can be placed at line 23 to retrieve an existing HttpSession object? (id); (true);

<HTML>
<BODY>
<FORM
ACTION=
http://loca
<HTML> lhost:808
<BODY> 0/servlet/
<FORM myservlet
ACTION= METHOD
http://loca =GET>
lhost:808 <INPUT
0/servlet/ TYPE=S
myservlet UBMIT
METHOD VALUE=S
=GET> UBMIT>
</FORM> </FORM>
Carefully read the question and answer accordingly. </BODY> </BODY>
Which of the following codes will allow the user to load the servlet using form. The form should
</HTML>
first display
</HTML>submit button and w
These
are
responsib
le for
managing
the
lifecycle
of
servlets,
mapping
a URL
(Universal
Resource
Locator)
to a
particular
servlet,
and
These ensuring
are that the
specialize URL
d Web requester
servers, has got
which the
support correct
Carefully read the question and answer accordingly. servlet access
Which of the following is applicable to Servlet Containers? execution rights

to provide
the
configurat
ion
details on
how the
web
server
provides should
security use them
informatio to serve
n of the the
Carefully read the question and answer accordingly. applicatio incoming
Which of the following can be considered as role(s)
Carefully read the question and answer accordingly. of a deployment descriptor in a .war or n.ear modules?
requests
You are developing dynamic web application using JSP. Which attribute of page directive specifies
import thesession
list of classes imported in

Carefully read the question and answer accordingly. Compilati


JSP syntax errors are caught during which lifecycle event of JSP? Execution on
Carefully read the question and answer accordingly. jspServic
Identify the method in which all our scriptlets code will be placed jspInit() e()
The init The
method of service
the method of
Carefully read the question and answer accordingly. generate generate
During translation
Carefully read the the scriptlet
question andcode is copied
answer inside:
accordingly. d servlet d servlet
A class can be declared as _______ if you do not want the class to be subclassed. Using protected final,interf
the __________keyword we can abstract a class from its implementation ,interface ace

Carefully read the question and answer accordingly. Statemen


Choose the correct option. Statemen t I is
Statement I: When an abstract class is sub classed, the subclass should provide the implementation
t I & II are for
TRUE
all the
& IIabstract method
Statement
} II: If the subclass does not implement the abstract method in its parent class, then
TRUEthe subclass
is FALSE
must also be declare
}Carefully read the question and answer accordingly. TRUE FALSE
Which of the following keywords ensures that a method cannot be overridden? final protected

Statemen
t A is true
Carefully read the question and answer accordingly. Both and
Statement A:finalize will always run before an object is garbage collected Statemen Statemen
Statement B:finalize method will be called only once by the garbage collector ts A and t B is
which of the following is true? B are true false
Carefully read the question and answer accordingly.
class Background implements Runnable{ It will It will
int i = 0; compile compile
public int run(){ and the and
while (true) { run calling
i++; method start will
System.out.println("i="+i); will print print out
} out the the
return 1; increasin increasin
} g value of g value of
}//End
} class i. i.
} int String
}
System.out.print("finished"); /* Line 24 */
} exception Compilati
}2.error finished on fails
3.compilation error 1&2 1&2&3
Carefully read the question and answer accordingly. ObjectInp StringRea
Which of these class are the member class of java.io package? ut der
Carefully read the question and answer accordingly.
Which of these class are related to input and output stream in terms of functioning? File Writer
Carefully read the question and answer accordingly. JDBC ODBC
The JDBC-ODBC Bridge driver translates the JDBC API to the ODBC API and used with which
drivers
of the drivers
following:

Both Statemen
Carefully read the question and answer accordingly. Statemen t A is True
Consider the following statements: t A and and
Statement A: The PreparedStatement object enables you to execute parameterized queries. Statemen Statemen
Statement B: The SQL query can use the placeholders which are replaced by the INPUT parameters
t B are tat
B runtime.
is
Which of the
Carefully readfollowing optionand
the question is True withaccordingly.
answer respect to the above statements? True. False.
What is the state of the parameters of the PreparedStatement object when the user clicks on
initialized
the Query
started
button?
adds 10 adds 10
seconds minutes
to the to the
Carefully read the question and answer accordingly. current current
What will be the output of the below query? Timestam Timestam
select to_CHAR(sysdate+(10/1400),'HH:MI:SS') from dual; p p

Statemen
t A is true
Carefully read the question and answer accordingly. Both and
Statement A:Listener process scans for connection requests to an Oracle Instance Statemen Statemen
Statement B:Listener process links up a dispatcher process to user process. ts A and t B is
which of the following is true? B are true false

Top 2 Top 2
Carefully read the question and answer accordingly. student student
What will be the output of the below query? record record
select Stud_name from ( with with
select rank() over(order by Marks desc) as rank ,Stud_name from StudentDetails highest lowest
order by Stud_name --LINE 1 marks will marks will
) be be
where rank > 3 displayed displayed

For using Flashbac


flashback k Query
query, the needs to
server be
need not enabled
be and
configure disabled
d to use using the
Automatic DBMS_F
Undo LASHBA
Carefully read the question and answer accordingly. Managem CK
Which of the following
FLASHBACK statement
TABLE Supplier TOisBEFORE
True withDROP;
respect to Query Flash Back? ent. package.
State True or False. TRUE FALSE

It would
be
It would created
be and
created would
Carefully read the question and answer accordingly. only if a use an
Evaluate the CREATE TABLE statement: unique automatic
CREATE TABLE products index is ally
(product_id NUMBER(6) CONSTRAINT prod_id_pk PRIMARY KEY, manually created
product_name VARCHAR2(15)); created unique
Which statement is true regarding the PROD_ID_PK constraint? first. index.
Carefully read the question and answer accordingly.
Evaluate the following SQL statements that are issued in the given order:
CREATE TABLE emp
(emp_no NUMBER(2) CONSTRAINT emp_emp_no_pk PRIMARY KEY,
enameVARCHAR2(15), It would
salary NUMBER(8,2), It would be
mgr_no NUMBER(2) CONSTRAINT emp_mgr_fk REFERENCES emp); be automatic
ALTER TABLE emp automatic ally
DISABLE CONSTRAINT emp_emp_no_pk CASCADE; ally enabled
ALTER TABLE emp enabled and
ENABLE CONSTRAINT emp_emp_no_pk; and immediat
What would be the status of the foreign key EMP_MGR_FK? deferred. e.

Start an
instance, Mount the
Open the database,
Database Start the
, Mount instance,
Carefully read the question and answer accordingly. the Open the
Which of the following gives the order of Database administrative steps needed to open andatabase
Oracle Database?
database

PURGE
DBA_RE PURGE
Carefully read the question and answer accordingly. CYCLEBI RECYCL
How to drop all tables from recycle bin? N EBIN

select
select empNam
empNam e ,
e, empNo
empNo from emp
from emp where
where empno
empno = exists
( select ( select
Carefully read the question and answer accordingly. deptNo deptNo
John wants to retrieve all the employee details whose Employee Number matches to any from from
of
Anthe Department
outer Number.
join returns all rowsHelp
that john to achieve
satisfy his task and those rows from one table for
the join condition dept)
which nodept)
rows from the other satis
State True or False. TRUE FALSE

Carefully read the question and answer accordingly. Statemen Statemen


Which of the Following Statements are true? t A is true t A is false
Statement A : Join permanently joins two tables having 1 or more common attributes and B is and B is
Statement
from studentB: sInner Joinsjoin
left outer arecollege
also called
c as EQUI Joins false. true.
where s.clg_code = c.clg_code 1&2 1&5
Carefully read the question and answer accordingly.
Identify the code snippet Employee
declare EmpNAME; name
begin whose All
SELECT ENAME INTO EmpNAME FROM Emp WHERE EmpNo=101172; employee employee
dbms_output.put_line(EmpName); no is names
end; 101172 is will be
what will be the
4. Identifiers output ofcan
in PL/SQL thecontain
above max
code35 character printed printed
5. Blocks read
Carefully of PL/SQL statements
the question are translated
and answer by the PL/SQL engine that can reside either1&2
accordingly. in the client
1&2&3
or at the server side.
In Oracle PL/SQL by default, variables are initialized to NULL. TRUE FALSE
Carefully read the question and answer accordingly.
The %ROWTYPE attribute provides a record type that represents a row in view index

Carefully read the question and answer accordingly.


Identify the type of variable declared Bind Host
VARIABLE City Varchar2(20). Variable Variable

Carefully read the question and answer accordingly. Nested Associativ


Which is called as index-by tables ? tables e arrays
Error ,
Carefully read the question and answer accordingly. exceeds 12345.56
If the declaration is Number (4,5) and the assigned value is 123.4567 , what is the stored value?
precision 7
Carefully read the question and answer accordingly. Statemen
Consider the following statements that describes a PL/SQL Block Structure: t1 and
Statement1: Declare and Exception Sections are mandatory. Statemen Only
Statement2: Begin and End Sections are optional. t2 are Statemen
Which of the following is applicable for above? true. t1 is True.
then
dbms_output.put_line('Less'); Compilati Compilati
end if; on fails on fails
END; due to due to
/ error on error on
What will be the result of the above code? line 1 line 2
The
CASE
statement
selects The
one selector is
sequence followed
of by one or
statement more
s to WHEN
execute. clauses,
To select which are
the checked
sequence sequentia
, the lly. The
CASE value of
statement the
uses a selector
selector determine
rather s which
than clause is
multiple executed.
Boolean If the
expressio value of
ns. A the
selector is selector
an equals
expressio the value
n whose of a
value is WHEN-
used to clause
select expressio
one of n, that
several WHEN
Carefully read the question and answer accordingly. alternativ clause is
What is meant by case statements in PLSQL? es executed
Carefully read the question and answer accordingly. _(undersc .-
The patterns
Carefully readmatched by LIKE
the question andcan include
answer two special-purpose characters called wildcards.
accordingly. ore) ( hyphen)
Comparisons involving nulls always yield NULL TRUE FALSE

A A
package package
specificati body
on can appears
exists without
without a package
Carefully read the question and answer accordingly. package specificati
What are the true aspects of PLSQL? body on
max_day max_day
s_in_year s_in_year
CONSTA CONSTA
NT NT
Carefully read the question and answer accordingly. INTEGER INTEGER
Pick the valid constant declaration in PL/SQL ; := 366;

Carefully read the question and answer accordingly. run time compile-
what is the result when we attempt to change the value
Carefully read the question and answer accordingly. of an IN parameter ? exception time error
The functions can return PL/SQL specific data types such as BOOLEAN, RECORD, or TABLE
TRUE FALSE

The
trigger
fails
because
it needs
The to be a
trigger row level
fires AFTER
Carefully read the question and answer accordingly. successfu UPDATE
You have a row level BEFORE UPDATE trigger on the EMP table. This trigger contains a SELECT
lly. statement
trigger. on the EMP table

Replacing
RAISE_A
PPLICATI
ON_ERR
OR(-
20000,
'no
negative
age
allowed');
to
RAISE_A
PPLICATI
Carefully read the question and answer accordingly. ONS_ER
You are developing a trigger which should ensure that no negative value is inserted in employee
The order
table’s
ROR(-
Age column . you have
create or replace trigger AgeVerify of 20000,
before insert Argument 'no
on employee for each row s passed negative
when(new.EmpAge < 0) to age
begin RAISE_A allowed');
RAISE_APPLICATION_ERROR(-20000, 'no negative age allowed'); PPLICATI will give
end; ON_ERR the
/ OR is desired
Identify error if any in
Return return_variable; the above trigger and give the solution. wrong output
END; TRUE FALSE
Open , Declare ,
Declare , Open ,
Carefully read the question and answer accordingly. Fetch Fetch ,
Consider you are creating a cursor,Choose the correct sequence of steps to work with cursors?
Close Close

Comparis
on
operators
cannot be
used to The value
test of a
cursor cursor
variables variable
for can be
equality, stored in
inequality, a
Carefully read the question and answer accordingly. null, or database
What are the restrictions of REF cursor in PLSQL? not null. column

The
select
statement
provided
within the
cursor
Opening statement
the cursor gets
allocates executed
the when we
Carefully read the question and answer accordingly. memory open the
What occurs when a cursor is opened? first. cursor.

When we
issues a
SELECT..
FOR
UPDATE
clause
the
RDBMS
will
automatic
ally place
a locks
on the all The
the rows records
identified will be
by the available
select for our
Carefully read the question and answer accordingly. statement changes
What is FOR UPDATE clause in Cursors? . only.
Choice3 Choice4 Choice5

By setting
the
setMaxIn
activeInte
rval()
method By using
period to the
60 destroy()
seconds method

HttpSessi
on
session =
request.g
etSession None of
("jsession the listed
id"); options

<HTML>
<BODY>
<FORM
ACTION=
http://loca
lhost:808
0/servlet
<HTML> METHOD
<BODY> =GET>
<INPUT <INPUT
TYPE=S TYPE=S
UBMIT UBMIT
VALUE=S VALUE=S
UBMIT> UBMIT>
</FORM> </FORM>
</BODY> </BODY>
</HTML> </HTML>
These
are also
referred
to as Web
container All of the
s or Web listed
engines. options

to provide
listener
informatio
n to notify
certain has to list
classes down the
when external
some API's
events which are
(like used in
session the web
creation) applicatio
happen n
extends language
Container
doesn't
mind JSP
Translatio syntax
n errors
_jspServi jspInitializ
ce() ation()
Scriptlet
The code gets
doGet() no place
method of in the
generate generate
d servlet d servlet
public,frie final,prote private,ab
nd cted stract
Statemen
t I is
FALSE & Statemen
II is t I & II are
TRUE FASLE

static abstract

Statemen Both
t A is false Statemen
and ts A and
Statemen B are
t B is true false

Compilati
on will
cause an
error
The code because
will cause while
an error cannot
at take a
compile paramete
time. r of true.
Object set1
finally
exception
finally finished
1&3 2 2&3

File String
OutputStr
Reader eam
Both A None of
and B the above

Statemen
t A is Both
False and Statemen
Statemen ts A and
t B is B are
True. False.
paused stopped
adds 10
days to date
the functions
current query cannot be
Timestam contains converted
p error into char

Statemen Both
t A is false Statemen
and ts A and
Statemen B are
t B is true false

If LINE 1
is
removed
Query will than the
generate query will
an error execute

Flashbac
k Query
does not
apply to
code
objects
like
Packages
,
Procedur
es,
Function None of
or the listed
Triggers options

It would
be
created
and
It would remains
be in a
created disabled
and state
would because
use an no index
automatic is
ally specified
created in the
nonuniqu command
e index. .
It would
remain
disabled It would
It would and can remain
remain be disabled
disabled enabled and has
and has only by to be
to be dropping enabled
enabled the manually
manually foreign using the
using the key ALTER
ALTER constraint Constrain
TABLE and re- t
command creating command
. it. .

Start an Start the


instance, database,
Mount the Start the
database, instance,
Open the Mount the
database Database

Cannot
drop
DROP DROP tables
ALL_TAB DBA_RE from
LE_REC CYCLEBI Recycle
YCLEBIN N Bin

select select
select empNam empNam
empNam e, e,
e, empNo empNo
empNo from emp from emp
from emp where where
where empno empno
empno in has Any between (
( select ( select select
deptNo deptNo deptNo
from from from
dept) dept) dept)

Both Both
statement statement
s A and B s A and B
are true. are false.
2&3 1&4 2&4
Employee
name
whose
employee
no is Compiles
101172 is The code and runs
printed if does not without
serverout compile any
put is on at all output
1&3&4 1&2&4 1&3&5

nested
table table
Invalid
Variable None of
declaratio Global the listed
n Variable options
None of
the listed
Varrays option

1234.556 1.234556
7 7
Statemen
Only t1 and
Statemen Statemen
t2 is t2 are
False. False.
Compiles
Compiles Compiles executes
executes executes and prints
and prints and prints 11 12 13
12 Less 12 More More
The
ELSE
clause
does not
works
similarly
to the
ELSE CASE
clause in statement
an IF s can be
statement
% labeled
(percent *
sign) (asterisk)

The
Subprogr
ams that
are
present
inside a
package
cannot
A exists
package separatel
can be y as
invoked database
by itself. objects.
CONSTA
NT
max_day
s_in_year None of
INTEGER the listed
:= 366; option
None of
the listed
no error option

The
trigger
The fails
trigger because
fails you
because cannot
a use the
SELECT minimum
statement and
on the maximum
table functions
being in a
updated BEFORE
is not UPDATE
allowed. trigger.

Replacing Replacing
RAISE_A RAISE_A
PPLICATI PPLICATI
ON_ERR ON_ERR
OR(- OR(-
20000, 20000,
'no 'no
negative negative
age age
allowed'); allowed');
to to
RAISE_A RAISE_A
PPLICATI PPLICATI
ONS_ER ON_ERR
ROR(- OR(-
20000,”n 20000,”n
o o
No negative negative
problem age age
in the allowed”); allowed”);
trigger. It will give will give
gives the the the
desired desired desired
result output output
Declare , Define ,
Open , Fetch , Open ,
Fetch , Open Fetch ,
Close Fetch Close

Two types
of cursors Null
are 1) cannot be
Strongly assigned
typed and to a
2) Weakly cursor
Typed. variable

Open
statement
retrieves
the rows The
from the active set
cursor pointer is
and will set to the
process second
it. row.

The lock
will not be
released
even if
we issue
ROLLBA
CK or
COMMIT None of
. the above

You might also like