Professional Documents
Culture Documents
{
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>"); <servlet> <servlet- <servlet> <servlet- <servlet> <servlet-
out.println("<title>My Servlet</title>"); name>hello</servlet name>myworld.hello</se name>hello</servlet-
out.println("</head>"); -name> <servlet- rvlet-name> <servlet- name> <servlet-
out.println("<body>"); <servlet> <servlet- class>myworld.hello class>hello</servlet- class>myworld.hello</se
out.println("<h>WELCOME</h>"); name>hello</servlet-name> </servlet-class> class> </servlet> rvlet-class> </servlet>
out.println("</body>"); <servlet- </servlet> <servlet- <servlet-mapping> <servlet-mapping>
out.println("</html>"); class>hello</servlet-class> mapping> <servlet- <servlet- <servlet-
out.close(); </servlet> <servlet- name>hello</servlet name>hello</servlet- name>hello</servlet-
} mapping> <servlet- -name> <url- name> <url- name> <url-
} name>hello</servlet-name> pattern>/hello</url- pattern>/hello</url- pattern>hello</url-
Which of the following code snippets correctly defines the deployment <url-pattern>/hello</url- pattern> </servlet- pattern> </servlet- pattern> </servlet-
descriptor for the preceding servlet? pattern> </servlet-mapping> mapping> mapping> mapping>
<HTML> <BODY>
<FORM
ACTION=http://local <HTML> <BODY>
host:8080/servlet/m <FORM
yservlet ACTION=http://localhost
METHOD=GET> :8080/servlet
Carefully read the question and answer accordingly. <HTML> <BODY> <FORM <INPUT <HTML> <BODY> METHOD=GET>
Which of the following codes will allow the user to load the servlet ACTION=http://localhost:80 TYPE=SUBMIT <INPUT TYPE=SUBMIT <INPUT TYPE=SUBMIT
using form. The form should first display submit button and when the 80/servlet/myservlet VALUE=SUBMIT> VALUE=SUBMIT> VALUE=SUBMIT>
user clicks on submit button it should load the servlet called METHOD=GET> </FORM> </FORM> </BODY> </FORM> </BODY> </FORM> </BODY>
myservlet? </BODY> </HTML> </HTML> </HTML> </HTML>
RequestDispatcher
RequestDispatcher dispatcher = RequestDispatcher
dispatcher = request.getRequest dispatcher =
request.getRequestDispatc Dispatcher("Servlet2 request.getRequestDispa
her("Servlet2"); "); tcher("Servlet2");
Carefully read the question and answer accordingly. dispatcher.forward(req, dispatcher.dispatch( dispatcher.chain(req, request.sendRedirect("S
Select the code to chain a servlet with another servlet resp); req, resp); resp); ervlet2");
Carefully read the question and answer accordingly.
Mahesh has observed that some users are able to directly access the By storing the
content files stored in the Web application from the Web browser. content files under By storing the content By storing the content
Which of the following options should Mahesh use to prevent the By storing the content files the META-INF files under the WEB-INF files under the INF
users from directly accessing the content files? under the dist directory directory directory directory
to provide the
configuration details to provide listener
on how the web information to notify has to list down the
Carefully read the question and answer accordingly. provides security server should use certain classes when external API's which are
Which of the following can be considered as role(s) of a deployment information of the them to serve the some events (like used in the web
descriptor in a .war or .ear modules? application incoming requests session creation) happen application
Carefully read the question and answer accordingly. Will be bundled inside
A web application contains images to be displayed across the UI the application, hence
screens. In a typical production environment, where these images will no need to deploy
be deployed? Application Server Web Server Proxy Server individually None of the above
To access the
application, the device
Web applications allows like mobile phones,
Little or no the users to invoke from tablets, computers need
diskspace is any device like mobile to open the port for
Carefully read the question and answer accordingly. web application provides required on the phones, tablets that has connectivity to web
Which of the following is / are true about web applications? cross platform compatibility client browsers server
public void
doGet(HttpServletR public void
equest req, doGet(HttpServletReque
public void HttpServletRespons st req,
doGet(HttpServletRequest e res) throws HttpServletResponse
req, HttpServletResponse ServletException, res) throws
res) throws IOException ServletException,
ServletException, { session = IOException { Session
IOException { HttpSession req.getSession(); session =
Carefully read the question and answer accordingly. session = req.getSession(); session.getAttribute( req.getSession();
Choose the valid option for creating session object and to add a session.setAttribute("BookI "BookID","Core session.setAttribute("Boo None of the listed
attribute "BOOKID" into session object. D","Core Java"); } Java"); } kID","Core Java"); } options
Carefully read the question and answer accordingly. None of the listed
Code to get the value of “address” request parameter is: ${param.address} ${Values.address} ${request.address} options
Carefully read the question and answer accordingly. A message box stating
Consider the following code snippet: for user's confirmation
<jsp:forward page="relativeURLspec"/> The execution of the about termination or
Which of the following statements is true about the execution status of The execution of the current current page is A run time error is continuation of the
the page where this statement has been written? page continues. terminated. displayed. application is displayed.
<jsp:import
page=”user-
pref.jsp”> <jsp:import file=”user- <jsp:include path=”user-
<jsp:include page=”user- <jsp:param pref.jsp”> <jsp:param pref.jsp”> <jsp:param
Carefully read the question and answer accordingly. pref.jsp”> <jsp:param name=”userPref” name=”userPref” name=”userPref”
In an web page how would you write the JSP standard action code to name=”userPref” value=”$ value=”$ value=”$ value=”$
import a JSP segment that generates user preference specific {user.preference}” /> {user.preference}” /> {user.preference}” /> {user.preference}” />
content? </jsp:include> </jsp:include> </jsp:import> </jsp:include>
<jsp:useBean
identity="login"
Carefully read the question and answer accordingly. scope="Session" <jsp:useBean id="login"
Consider the following code snippet of JSP Bean: <jsp:useBean id="login" class="s.beans.Logi <jsp:useBean id="login" scope="Session"
<jsp:usebean identity="login" scope="Session" scope="Session" nBean"> <%! scope="Session" class="s.beans.LoginBe
class=s.beans.LoginBean> class="s.beans.LoginBean" login.setValue(reque class="s.beans.LoginBea an">
<%! > <% st.getParameter("Lo n"> <login.setValue(request.
login.setValue(request.getParameter("Loginid")); login.setValue(request.getP ginid")); login.setValue(request.g getParameter("Loginid"))
login.setAddress(request.getParameter("address")); arameter("Loginid")); login.setAddress(req etParameter("Loginid")); ;/>
%> login.setAddress(request.ge uest.getParameter(" login.setAddress(request. <login.setAddress(reque
<jsp:usebean> tParameter("address")); %> address")); %> getParameter("address")) st.getParameter("addres
However the preceding code contains errors. Predict the correct code. </jsp:useBean> <jsp:useBean> ; </jsp:useBean> s"));/> </jsp:useBean>
Carefully read the question and answer accordingly. Print something on the Write a block of java
The purpose of a JSP Expression tag is to: screen Declare a variable Import a java class code
Carefully read the question and answer accordingly. None of the listed
Which of the following methods can not be over-ridden ? jspInit() _jspService() jspDestroy() options
Carefully read the question and answer accordingly. Container doesn't mind
JSP syntax errors are caught during which lifecycle event of JSP? Execution Compilation Translation JSP syntax errors
JSP page is
JSP page is translated to a translated to a
servlet, servlet is loaded servlet, code is JSP is compiled, JSP JSP is loaded into
into memory, code is compiled, servlet is page is translated to a memory, Code is
Carefully read the question and answer accordingly. compiled, instance is loaded into memory, servlet, code is loaded, compiled, instance is
Which of the following describes the jsp life cycle process best? created instance is created instance is created created
Carefully read the question and answer accordingly. None of the listed
Which of the following tag disables scriplets? <is-scripting-invalid> <scripting-invalid> <scripting-disabled> options
Carefully read the question and answer accordingly. Servlet lifecycle Multithreading
Which of the following is NOT a Container feature? management support JSP support Application Controller
Carefully read the question and answer accordingly. Servlets are written in the Servlets are written Servlets are written in the Servlets are written in
What language is used to write servlets and JSP? Java language in the Java script C++ the PHP
Carefully read the question and answer accordingly. None of the listed
Which of the following have default value set to true? session isELIgnored isErrorPage options
o.exe();
} super class exe
super class exe method sub method super class None of the listed
} class display method display method Compilation error options
Carefully read the question and answer accordingly. Synchronized Synchronized abstract Synchronized
Synchronization is achieved by using which of the below methods Synchronized blocks methods Synchronized classes classes interfaces
Carefully read the question and answer accordingly. All implementations All implementations are all implementations are
which are the Basic features of implementations of interfaces in All implementations are support having null serializable and immutable and supports
Collections Framework in java? unsynchronized elements. cloneable duplicates data
try
{
}
catch(IOException t)
{
System.out.println("B");
}
System.out.println("C");
}
} Compile time error A A,C Runtime error
Carefully read the question and answer accordingly.
What will be the output of the program?
public class Test {
public static void aMethod() throws Exception {
try {
throw new Exception();
} finally {
System.out.print("finally");
}
}
public static void main(String args[]) {
try {
aMethod();
} catch (Exception e) {
System.out.print("exception ");
}
System.out.print("finished"); /* Line 24 */
}
} exception finished Compilation fails finally finally exception finished
RunTimeException are
Runtime exceptions need Runtime exceptions the exceptions which
not be explicitly caught in try include arithmetic forces the programmer
Carefully read the question and answer accordingly. catch block as it can occur exceptions, pointer RuntimeException is a to catch them explicitly
what are true for RuntimeException anywhere in a program. exceptions class of I/O exception in try-catch block
Carefully read the question and answer accordingly.
What will be the output of following code?
try
{
System.out.println("Executing try");
}
System.out.println("After try");
catch (Exception ex)
{
System.out.println("Executing catch"); Executing try After try Executing try
} Executing catch Runtime Exception Compile Time Exception Runtime Exception
Carefully read the question and answer accordingly. Array Index Out Of Number Format
which are the Unchecked exceptions Class Cast Exception Bounds Exception ClassNotFoundException Exception
Carefully read the question and answer accordingly. Both by value &
Data can be passed to the function ____ by value by reference reference none of these
Carefully read the question and answer accordingly. The number of bytes is
What is the number of bytes used by Java primitive long compiler dependent 2 4 8 64
Connection
cn=DriverManager.g Connection Connection
Carefully read the question and answer accordingly. etConnection("jdbc: cn=DriverManager.getCo cn=DriverManager.getC
You are using JDBC-ODBC bridge driver to establish a connection Connection odbc:Mydsn", nnection("jdbc:odbc onnection("jdbc:odbc:ds
with a database. You have created a DSN Mydsn. Which statement cn=DriverManager.getConn "username", ","username", n" ,"username",
will you use to connect to the database? ection("jdbc:odbc"); "password"); "password"); "password");
Flashback Query
needs to be enabled Flashback Query does
For using flashback query, and disabled using not apply to code objects
Carefully read the question and answer accordingly. the server need not be the like Packages,
Which of the following statement is True with respect to Query Flash configured to use Automatic DBMS_FLASHBAC Procedures, Function or None of the listed
Back? Undo Management. K package. Triggers options
Carefully read the question and answer accordingly. Create sequence Create sequence MySeq Create sequence MySeq Create sequence
Identify the correct syntax to create a sequence which generates Create sequence MySeq MySeq ( Start with 2 ( Start with 2 Increment Start with 2 Increment MySeq as Start with 2
values as 2,4,6,8,10? Start with 2 Increment by 1 Increment by 1 ) by 2 ) by 2 Increment by 2
Carefully read the question and answer accordingly. Start an instance, Open the Mount the database, Start an instance, Mount Start the database, Start
Which of the following gives the order of Database administrative Database, Mount the Start the instance, the database, Open the the instance, Mount the
steps needed to open an Oracle Database? database Open the database database(smo) Database
DROP
Carefully read the question and answer accordingly. PURGE PURGE ALL_TABLE_RECYCLE DROP Cannot drop tables
How to drop all tables from recycle bin? DBA_RECYCLEBIN RECYCLEBIN BIN DBA_RECYCLEBIN from Recycle Bin
In the statement, which capabilities of a SELECT statement are Difference,Projectio Selection, Intersection, Intersection, Projection,
performed? Selection, Projection, Join n, Join Join Join
You can join "n"
tables(all having
To join two tables single column primary
through an equijoin, the keys)in a SQL
You can join a You specify an equijoin columns in the join statement by
You can join a maximum of maximum of two condition in the SELECT condition must be specifying a minimum
Carefully read the question and answer accordingly. two tables through an columns through an or FROM clauses of a primary key an foreign of "n-1" join
What is true about joining tables through an equijoin? equijoin. equijoin. SELECT statement. key columns. conditions.
Carefully read the question and answer accordingly. Select count(*) from Select count(*) from Select count(*) from
John wants to see how many employees are there whose salary is Select count(*) from emp emp where sal > Select count(*) from emp emp where sal exist emp where sal in
above average. where sal > (select max(sal) (select Avg(sal) from where sal > (select (select avg(sal) from (select avg(sal) from
Which of the following query will help john to achieve this task? from emp); emp); Average(sal) from emp); emp); emp);
Column constraints,
such as the NOT
NULL and check Column constraints, such
We can use the %TYPE constraint, or default as the NOT NULL and
attribute as a datatype values are not check constraint, or %TYPE is used when
specifier when declaring inherited by items default values are declaring variables to
Carefully read the question and answer accordingly. constants, variables, fields, declared using inherited by items hold database table
What is meant by %Type? and parameters. %TYPE. declared using %TYPE. values
Carefully read the question and answer accordingly. %TYPE variables do not %TYPE variables do
Pick the CORRECT statement about %TYPE variables inherit NOT NULL not inherit check %TYPE variables do not %TYPE variables inherit
such as the NOT NULL or or default values constraints constraint, inherit default values default values
In a table, if no single
Primary Key column can be assigned
constraint has to be uniquely as primary key,
Carefully read the question and answer accordingly. A Default index is created in explicitly dropped A primary key can be then a combination of
In SQL, which of the following is NOT true with respect to Primary the column which acts as a before completely referenced in another two columns can act as
Key? Primary key. removing the table. table as a Foreign Key. a Primary Key.
The selector is
followed by one or
more WHEN
clauses, which are
The CASE statement checked
selects one sequence of sequentially. The
statements to execute. To value of the selector
select the sequence, the determines which
CASE statement uses a clause is executed.
selector rather than multiple If the value of the
Boolean expressions. A selector equals the
selector is an expression value of a WHEN- The ELSE clause does
whose value is used to clause expression, not works similarly to the
Carefully read the question and answer accordingly. select one of several that WHEN clause is ELSE clause in an IF CASE statements can
What is meant by case statements in PLSQL? alternatives executed statement be labeled
A GOTO statement
can transfer control
from one IF
A GOTO statement cannot statement clause to
transfer control into an IF another, or from one
statement, CASE CASE statement A GOTO statement can A GOTO statement
Carefully read the question and answer accordingly. statement, LOOP WHEN clause to transfer control into an cannot transfer control
What are the restrictions of GO TO statements? statement, or sub-block. another. exception handler. out of a subprogram.
CREATE OR
REPLACE
TRIGGER
check_sal BEFORE
UPDATE OF sal ON CREATE OR REPLACE CREATE OR REPLACE
emp FOR EACH TRIGGER check_sal TRIGGER check_sal
ROW WHEN BEFORE UPDATE OF AFTER UPDATE OR sal
(new.sal < old.sal sal ON emp WHEN ON emp WHEN
OR new.sal > old.sal (new.sal < old.sal OR (new.sal < old.sal OR
* 1.1) BEGIN new.sal > old.sal * 1.1) -new.sal > old.sal * 1.1)
RAISE_APPLICATI BEGIN BEGIN
ON_ERROR ( - RAISE_APPLICATION_ RAISE_APPLICATION_
ALTER TABLE emp ADD 20508, ‘Do not ERROR ( - 20508, ‘Do ERROR ( - 20508, ‘Do
Carefully read the question and answer accordingly. CONSTRAINT ck_sal decrease salary not not decrease salary not not decrease salary not
Which code can you use to ensure that the salary is not increased by CHECK (sal BETWEEN sal increase by more increase by more than increase by more than None of the listed
more than 10% at a time nor is it ever decreased? AND sal*1.1); than 10%’); END; 10%’); END; 10%’); END; options
When a PL/SQL-
packaged construct The package
is referenced for the specification may also
first time, the whole include PRAGMAs, PRAGMAs are not
Carefully read the question and answer accordingly. package is loaded which are directives to allowed as part of
Which are VALID statement about PL/SQL package ? Package body is optional into memory the compiler package specification
Functions called
from: An UPDATE Functions called from:
or DELETE An UPDATE or DELETE
statement on a table Functions called from: • statement on a table T
Functions called from: • A T cannot query or A SELECT statement can query or contain
Carefully read the question and answer accordingly. SELECT statement cannot contain DML on the can contain DML DML on the same table
Which are TRUE about calling a function from SQL expressions ? contain DML statements same table T statements T
The select
statement provided
within the cursor
statement gets Open statement retrieves
Carefully read the question and answer accordingly. Opening the cursor executed when we the rows from the cursor The active set pointer is
What occurs when a cursor is opened? allocates the memory first. open the cursor. and will process it. set to the second row.
When we issues a
SELECT.. FOR UPDATE
clause the RDBMS will The lock will not be
automatically place a locks The records will be released even if we issue
Carefully read the question and answer accordingly. on the all the rows identified available for our ROLLBACK or
What is FOR UPDATE clause in Cursors? by the select statement. changes only. COMMIT . None of the above
DECLARE
Carefully read the question and answer accordingly. CURSOR DECLARE CURSOR
How to convert the following code using the cursor FOR LOOP? occupancy_cur IS DECLARE CURSOR occupancy_cur IS
DECLARE DECLARE CURSOR SELECT pet_id, occupancy_cur IS SELECT pet_id,
CURSOR occupancy_cur IS occupancy_cur IS SELECT room_number SELECT pet_id, room_number FROM
SELECT pet_id, room_number pet_id, room_number FROM occupancy room_number FROM occupancy WHERE
FROM occupancy WHERE occupied_dt = SYSDATE; FROM occupancy WHERE WHERE occupancy WHERE occupied_dt =
occupancy_rec occupancy_cur%ROWTYPE; occupied_dt = SYSDATE; occupied_dt = occupied_dt = SYSDATE; BEGIN
BEGIN occupancy_rec SYSDATE; BEGIN SYSDATE; BEGIN FOR OPEN occupancy_cur
OPEN occupancy_cur; occupancy_cur FOR occupancy_rec occupancy_rec IN FOR occupancy_rec IN
LOOP %ROWTYPE; BEGIN FOR IN occupancy_cur occupancy_cur LOOP occupancy_cur LOOP
FETCH occupancy_cur INTO occupancy_rec; occupancy_rec IN LOOP update_bill update_bill update_bill
EXIT WHEN occupancy_cur%NOTFOUND; occupancy_cur LOOP (occupancy_rec.pet (occupancy_rec.pet_id, (occupancy_rec.pet_id,
update_bill (occupancy_rec.pet_id, occupancy_rec.room_number); update_bill _id, occupancy_rec.room_nu occupancy_rec.room_nu
END LOOP; (occupancy_rec.pet_id, occupancy_rec.roo mber); END LOOP; mber); END LOOP;
CLOSE occupancy_cur; occupancy_rec.room_numb m_number); END CLOSE occupancy_cur; CLOSE occupancy_cur;
END; er); END LOOP; END; LOOP; END; END; END;
DECLARE
exception_name DECLARE
EXCEPTION exception_name DECLARE
DECLARE exception_name PRAGMA EXCEPTION PRAGMA exception_name
EXCEPTION EXCEPTION_INIT EXCEPTION_INIT EXCEPTION PRAGMA
EXCEPTION_INIT (exception_name , (exception_name , EXCEPTION_INIT
PRAGMA err_code); Begin err_code); Begin (exception_name);
(exception_name , Execution section Execution section Begin Execution section
err_code); Begin Execution Exception WHEN Exception WHEN Exception WHEN
section Exception WHEN exception_name PRAGMA exception_init exception_name THEN
Carefully read the question and answer accordingly. exception_name THEN THEN Handle the THEN Handle the Handle the exception
What is the syntax of PRAGMA EXCEPTION_INIT? Handle the exception END; exception END; exception END; END;
Implicit cursors are Whenever a DML
automatically created by statement (INSERT,
oracle when a select query For INSERT UPDATE and DELETE)
in PLSQL is executed. operations, the is issued, an implicit
Explicit cursors is explicitly implicit cursor holds cursor is not The implicit cursor is
Carefully read the question and answer accordingly. attached to a select query the data that need automatically associated declared in the
What are the true aspects of implicit and explicit cursors? by programmer. to be inserted with this statement declaration section.
Alternative text to be
Carefully read the question and answer accordingly. ID used to identify displayed if the image is None of the listed
ALT' attribute in <IMG> tag used to represents Image filename the image not displayed options
Carefully read the question and answer accordingly. None of the listed
Which tag is used to include multiple HTML pages in single page? frame frameset frames options
Carefully read the question and answer accordingly. JavaScript can be Java Script can be
Please select the correct statement with respect to including JavaScript can be written written inside the written as an external file
JavaScript in HTML pages. inside the page body header and imported to the page All of the listed options
Carefully read the question and answer accordingly.
In JavaScript, for accessing first paragraph tag in the document which document.getElementsByTa document.getEleme document.getElementsB None of the listed
of the statement is used? gName("p")[0] ntsByTagName("p") yTagName("p[0]") options
Carefully read the question and answer accordingly. <message> if <message> if price <message> if price < None of the listed
Which of the following XML statement is valid? price<60</message> lt 60 </message> 60</message> options
Carefully read the question and answer accordingly. Document Type None of the listed
What does DTD stands for? Direct Type Definition Definition Dynamic Type Definition options
An Application can use
DTD are used as the DTD to validate the
Carefully read the question and answer accordingly. DTD are used by parsers for contract between XML structure it has
Which of the following correctly defines use of DTD in XML validating the structure of two systems to received from external
development? the XML interoperate. systems All of the listed options
Carefully read the question and answer accordingly.
Any text that should not be parsed by the xml parser needs to declare
as:
I: PCDATA None of the listed
II: CDATA I II Both I & II options
Carefully read the question and answer accordingly. eXtensible Markup Example Markup
What does XML stand for? eXtra Modern Link Language Language X-Markup Language
Carefully read the question and answer accordingly. None of the listed
Which parser is a W3C standard? SAX DOM XHTML options
Carefully read the question and answer accordingly. None of the listed
Which defines standard set of objects for creating XML's? SAX XMLDOM XML options
DocumentBuilder
Carefully read the question and answer accordingly. DocumentBuilder b=new DocumentBuilder b=factory.new None of the listed
Which statement creates DocumentBuilder instance? DocumentBuilder(); b=new Builder(); DocumentBuilder(); options
Carefully read the question and answer accordingly. Extensive Style sheet Extensible Style Extensible Style Sheet None of the listed
What does XSL stands for? language Language Language options
DocumentBuilderFa
DocumentBuilderFactory ctory f= DocumentBuilderFactory
Carefully read the question and answer accordingly. f=new BuilderFactory.newI f=DocumentBuilderFacto None of the listed
Which statement creates DocumentBuilderFactory instance? DocumentBuilderFactory(); nstance(); ry.newInstance(); options
Carefully read the question and answer accordingly. None of the listed
Which language is used for formatting XML documents? XSL XSLT XSL-FO options
Carefully read the question and answer accordingly. None of the listed
Which is used to transform XML document? Xpath XSLT XSL options
Carefully read the question and answer accordingly.
What are the two common exceptions in JAXP?
1.ParserConfigurationException
2.FactoryConfigurationException
3.FactoryConfigurationError 1&2 3 1&3 1
Carefully read the question and answer accordingly. Java API eXtensive Java API eXtensible Java API for XML None of the listed
JAXP Stands for: processing Processing Processing options
Carefully read the question and answer accordingly. None of the listed
In which package JAXP related API's are available? javax.xml.parsers.*; javax.xml.*; javax.parsers.xml.*; options
<xs:complexType
name="CountrInfo"> <xs:complexType
<xs:choice> name="CountrInfo"><xs:
<xs:complexType <xs:element sequence> <xs:element
name="CountrInfo"><xs:all> name="countryNam name="countryName"
<xs:element e" type="xs:string"/> type="xs:string"/>
name="countryName" <xs:element <xs:element
type="xs:string"/> name="states" name="states"
Carefully read the question and answer accordingly. <xs:element name="states" type="xs:integer"/>< type="xs:integer"/></xs:s
Which complex type specifies that the elements should always be in type="xs:integer"/></xs:all> /xs:choice></xs:com equence></xs:complexT None of the listed
the order specified? </xs:complexType> plexType> ype> options
<xs:complexType
name="CountrInfo"> <xs:complexType
<xs:choice> name="CountrInfo"><xs:
<xs:complexType <xs:element sequence> <xs:element
name="CountrInfo"><xs:all> name="countryNam name="countryName"
<xs:element e" type="xs:string"/> type="xs:string"/>
name="countryName" <xs:element <xs:element
type="xs:string"/> name="states" name="states"
Carefully read the question and answer accordingly. <xs:element name="states" type="xs:integer"/>< type="xs:integer"/></xs:s
Which complex type signifies that only one of the child elements can type="xs:integer"/></xs:all> /xs:choice></xs:com equence></xs:complexT None of the listed
appear? </xs:complexType> plexType> ype> options
If the equals()
method returns
Carefully read the question and answer accordingly. If the equals() method false, the If the hashCode() If the hashCode()
Which statements are true about comparing two instances of the returns true, the hashCode() hashCode() comparison == returns comparison == returns
same class, given that the comparison == might return comparison == true, the equals() method true, the equals()
equals() and hashCode() methods have been properly overridden? false might return true must return true method might return true
Carefully read the question and answer accordingly. Both of them will be
What will happen if two thread of same priority are called to be Any one will be executed executed None of them will be It is dependent on the
processed simultaneously? first lexographically simultaneously executed operating system.
CREATE TRIGGER
log_errors AFTER
SERVERERROR
ON DATABASE
BEGIN IF CREATE TRIGGER
CREATE TRIGGER (IS_SERVERERRO AFTER SERVERERROR
log_errors BEGIN IF R (1017)) THEN ON DATABASE BEGIN
(IS_SERVERERROR <special processing IF (IS_SERVERERROR
(1017)) THEN <special of logon error> (1017)) THEN <special
Carefully read the question and answer accordingly. processing of logon error> ELSE <log error processing of logon
Which of the trigger is used to log all errors and also to do some ELSE <log error number> number> END IF; error> ELSE <log error
special processing when the log error is 1017? END IF; END; END; number> END IF; END; None of the above
CREATE OR
REPLACE
PACKAGE
employee_package
AS TYPE
t_ref_cursor IS REF
CURSOR; TYPE
emp_rec IS CREATE OR REPLACE
RECORD PACKAGE
( employeeid employee_package AS
CREATE OR REPLACE NUMBER, firstname TYPE t_ref_cursor IS
PACKAGE VARCHAR2(10), REF CURSOR; TYPE
employee_package AS lastname emp_rec IS RECORD
TYPE emp_rec IS RECORD VARCHAR2(10), ( employeeid NUMBER,
( employeeid NUMBER, salary NUMBER); firstname VARCHAR2,
firstname VARCHAR2(10), minimum_count lastname VARCHAR2,
lastname VARCHAR2(10), CONSTANT salary NUMBER);
salary NUMBER); NUMBER := 4; minimum_count
Carefully read the question and answer accordingly. minimum_count FUNCTION CONSTANT NUMBER :=
Which is the valid Package specification for the below requirements. CONSTANT NUMBER := 4; get_employee 4; FUNCTION
1) A procedure to update each professors salary FUNCTION get_employee RETURN emp_rec; get_employee RETURN
2) A function to return the professor details who receive less salary RETURN emp_rec; PROCEDURE emp_rec; PROCEDURE
compared to others. PROCEDURE update_salary update_salary
3) A REF CURSOR to be declared update_salary (employeeid (employeeid IN (employeeid IN
4) A employee record with employeeid , employee name , salary. IN NUMBER); END NUMBER); END NUMBER); END None of the listed
5) A constant with datatype NUMBER with value 4 employee_package; employee_package; employee_package; options
Global enforcement
Faster application of business rules. Easier maintenance. If a
development. Because the Define a trigger business policy changes, Improve performance in
database stores triggers, once and then reuse you need to change only client/server
Carefully read the question and answer accordingly. you do not have to code the it for any application the corresponding trigger environment. All rules
Which of the following is the benefits using triggers in database trigger actions into each that uses the program instead of each run in the server before All of the listed
management system? database application. database. application program. the result returns. options
Carefully read the question and answer accordingly.
What is the collection exception raised for the below code?
DECLARE
TYPE NumList IS TABLE OF NUMBER;
nums NumList;
BEGIN
nums(1) := 1; SUBSCRIPT_BEYOND_CO COLLECTION_IS_N
END; UNT ULL NO_DATA_FOUND VALUE_ERROR
IF
old_company_rec.name
=
new_company_rec.name
AND
old_company_rec.incorp
_date =
new_company_rec.incor
p_date AND
old_company_rec.addres
IF old_company_rec s1 =
Carefully read the question and answer accordingly. > new_company_rec.addre
How do we compare records? new_company_rec) ss1 AND THEN ... the Records cannot be
(old_company_rec, new_company_rec are 2 records with name , IF old_company_rec IS THEN -------- END two records are compared with each
incorp_date, address1 as fields) NULL THEN -------.. END IF; IF; identical ... END IF; other.
Carefully read the question and answer accordingly.
What exception the below code will raise?
DECLARE
TYPE tab_numbers IS TABLE OF NUMBER
INDEX BY PLS_INTEGER;
l_numbers tab_numbers;
BEGIN
DBMS_OUTPUT.PUT_LINE (l_numbers (100)); SUBSCRIPT_BEYOND_ None of the listed
END; TOO_MANY_ROWS NO_DATA_FOUND COUNT options
CREATE OR
REPLACE
TRIGGER CREATE OR REPLACE
CREATE OR REPLACE salary_changes TRIGGER
TRIGGER salary_changes BEFORE DELETE salary_changes
BEFORE DELETE OR OR INSERT OR BEFORE DELETE OR
INSERT OR UPDATE ON UPDATE ON INSERT OR UPDATE
TBL_EMPLOYEES FOR TBL_EMPLOYEES ON TBL_EMPLOYEES
EACH ROW DECLARE FOR EACH ROW DECLARE sal_diff
sal_diff NUMBER; BEGIN DECLARE sal_diff NUMBER; BEGIN
sal_diff := :NEW.salary - NUMBER; BEGIN sal_diff := :NEW.salary
:OLD.salary; DBMS_OUTPUT.PU - :OLD.salary;
DBMS_OUTPUT.PUT(:OLD T(:OLD.firstname||','| DBMS_OUTPUT.PUT(:O
.firstname||','||:OLD.lastnam |:OLD.lastname|| ': LD.firstname||','||:OLD.las
e|| ': '); '); tname|| ': ');
DBMS_OUTPUT.PUT('Old DBMS_OUTPUT.PU DBMS_OUTPUT.PUT('Ol
salary = ' || :OLD.salary || ', T('Old salary = ' || d salary = ' || :OLD.salary
Carefully read the question and answer accordingly. '); :OLD.salary || ', '); || ', ');
Which trigger is used to display the salary change information DBMS_OUTPUT.PUT('New DBMS_OUTPUT.PU DBMS_OUTPUT.PUT('N
whenever a DELETE , INSERT or UPDATE statement affects the salary = ' || :NEW.salary || ', T('New salary = ' ew salary = ' ||
tbl_employees table(Salary Column)- The trigger should be FOR '); || :NEW.salary || ', '); :NEW.salary || ', ');
EACH ROW trigger. DBMS_OUTPUT.PUT_LINE DBMS_OUTPUT.PU DBMS_OUTPUT.PUT_LI
SAMPLE OUTPUT : Fahan,Karn: Old salary = 3500, New salary = ('Difference: ' || sal_diff); T_LINE('Difference: NE('Difference: ' ||
4500, Difference: 1000 END; ' || sal_diff); END; sal_diff); END;
Carefully read the question and answer accordingly. The DESCRIBE Dept
Consider the following SQL statements: statement displays the
CREATE Table dept (deptno number (2), deptname varchar (20), loc The Rollback structure of the Dept
varchar (20)); statement frees the The Describe Dept table only if there is a
ROLLBACK The Describe statement storage space statement returns an COMMITstatement
DESCRIBE dept displays the structure of the occupied by the error ORA-04043: object introduced before the
Which of the following statement is true about the above? Department table. Dept table. Dept does not exist. ROLLBACK statement.
DECLARE TYPE
TimeTyprec IS
DECLARE TYPE RECORD ( minutes
DECLARE TYPE TimeTyprec IS DECLARE TYPE DATE, hours DATE );
TimeTyprec IS RECORD RECORD ( minutes TimeTyprec IS RECORD TYPE Meetingmode IS
( minutes DATE, hours DATE, hours ( minutes DATE, hours RECORD ( day DATE,
DATE ); TYPE DATE ); TYPE DATE ); TYPE time_of TimeTyprec,
Meetingmode IS RECORD ( Meetingmode IS Meetingmode IS dept TBL_departments
day DATE, time_of RECORD ( day RECORD ( day DATE, %ROWTYPE, place
TimeTyprec, dept DATE, time_of time_of TimeTyprec, dept VARCHAR2(20),
TBL_departments TimeTyprec, dept TBL_departments purpose
%ROWTYPE, place TBL_departments %ROWTYPE, place VARCHAR2(50) ); TYPE
VARCHAR2(20), purpose %ROWTYPE, place VARCHAR2(20), ToMeet IS RECORD
VARCHAR2(50) ); TYPE VARCHAR2(20), purpose VARCHAR2(50) ( day DATE, time_of
ToMeet IS RECORD ( day purpose ); TYPE ToMeet IS DATE, dept
DATE, time_of DATE, dept VARCHAR2(50) ); RECORD ( day DATE, TBL_departments
TBL_departments meeting time_of TimeTyprec, dept %ROWTYPE, place
%ROWTYPE, place Meetingmode; TBL_departments VARCHAR2(20),
VARCHAR2(20), purpose seminar %ROWTYPE, time purpose
VARCHAR2(50) ); meeting Meetingmode; SMALLINT); meeting VARCHAR2(50) );
Meetingmode; seminar BEGIN Meetingmode; seminar meeting Meetingmode;
ToMeet; BEGIN seminar.time_of := ToMeet; BEGIN seminar ToMeet; BEGIN
Carefully read the question and answer accordingly. seminar.time_of := meeting.time_of; seminar.time_of := seminar.time_of :=
Which is the valid code to declare the nested records meeting.time_of; END; END; meeting.time_of; END; meeting.time_of; END;
It increases the
It reduces network traffic by complexity of the
combining multiple calls into remote interface and It increases the network
one network call and fetch access by removing Minimizes the latency performance by
Carefully read the question and answer accordingly. and return multiple values in coarse grained and server resource introducing multiple fine
Select the benefit of using Transfer Object design pattern one trip methods usage grained remote requests
Software coupling
defined as the Cohesion is clear Cohesion is the OO
degree to which a separation of related principle most closely
Cohesion is the OO software module functionality into distinct associated with
Carefully read the question and answer accordingly. Concept which hides the relies or depends on modules, Components , Cohesion maximizes allowing an object to
Which are the statements are true implementation other modules. or classes. code reusability have many types