0

databases Online Quiz - 52

Description: databases Online Quiz - 52
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0

Choose the best statement that best describes the relationship between JSP and servlets

  1. Servlets are built on JSP semantics and all servlets are compiled to JSP pages for runtime usage.

  2. JSPs are built on servlet semantics and all JSPs are compiled to servlets for runtime usage.

  3. JSP and servlets are unrelated technologies.

  4. None of the Above


Correct Option: B

AI Explanation

To answer this question, you need to understand the relationship between JSP (JavaServer Pages) and servlets.

Option A) Servlets are built on JSP semantics and all servlets are compiled to JSP pages for runtime usage. This option is incorrect because servlets are not built on JSP semantics. Servlets and JSPs are separate technologies and have different semantics.

Option B) JSPs are built on servlet semantics and all JSPs are compiled to servlets for runtime usage. This option is correct. JSPs are built on servlet semantics, meaning that JSPs are translated into servlets before being executed. During runtime, the JSP pages are compiled into servlets by the JSP container, which is then used to process the requests and generate the responses.

Option C) JSP and servlets are unrelated technologies. This option is incorrect. JSP and servlets are related technologies and are often used together in Java web applications. JSPs are a higher-level abstraction that allows developers to embed Java code within HTML-like pages, while servlets are Java classes that handle the processing of HTTP requests and responses.

Option D) None of the Above. This option is incorrect because Option B is the correct answer.

The correct answer is B. JSPs are built on servlet semantics, and all JSPs are compiled to servlets for runtime usage.

Which property of Exception class provides the line number of the code that caused exception:

  1. Message

  2. StackTrace

  3. Source

  4. Line number


Correct Option: B

If a Runtime Exception is thrown in the finalize method

  1. The running application crashes`

  2. The exception is simply ignored and the object is garbage collected

  3. The exception is simply ignored, but the object is not garbage collected

  4. If a Runtime Exception is thrown in the finalize method


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) The running application crashes - This option is incorrect because if a Runtime Exception is thrown in the finalize method, it does not necessarily mean that the entire application will crash. The finalize method is called by the garbage collector before an object is garbage collected, and any exception thrown in this method does not directly affect the running application.

Option B) The exception is simply ignored and the object is garbage collected - This option is correct. When a Runtime Exception is thrown in the finalize method, it is simply ignored by the garbage collector. The object will still be eligible for garbage collection and will be collected at some point in the future.

Option C) The exception is simply ignored, but the object is not garbage collected - This option is incorrect. Regardless of whether an exception is thrown in the finalize method or not, the object will still be eligible for garbage collection. The exception does not prevent the object from being garbage collected.

Option D) If a Runtime Exception is thrown in the finalize method - This option is incomplete and does not provide a complete statement.

The correct answer is B) The exception is simply ignored and the object is garbage collected. This option is correct because any exception thrown in the finalize method is ignored and does not prevent the object from being garbage collected.

Choose the correct statement from the given choice?

  1. Arrays in Java are essentially objects

  2. It is not possible to assign one array to another. Individual elements of array can however be assigned.

  3. Array elements are indexed from 1 to size of array

  4. If a method tries to access an array element beyond its range, a compile warning is generated.


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Arrays in Java are essentially objects - This option is correct because arrays in Java are indeed objects. In Java, arrays are a special type of object that can hold a fixed number of elements of the same type.

Option B) It is not possible to assign one array to another. Individual elements of the array can, however, be assigned - This option is incorrect. In Java, it is possible to assign one array to another using the assignment operator. For example: int[] array1 = {1, 2, 3}; int[] array2 = array1;. This assigns array1 to array2, meaning both arrays now refer to the same memory location.

Option C) Array elements are indexed from 1 to the size of the array - This option is incorrect. In Java, array elements are indexed from 0 to size-1. The first element of an array is accessed using the index 0, not 1.

Option D) If a method tries to access an array element beyond its range, a compile warning is generated - This option is incorrect. In Java, if a method tries to access an array element beyond its range, it will not generate a compile warning. Instead, it will throw an ArrayIndexOutOfBoundsException at runtime.

The correct answer is A) Arrays in Java are essentially objects. This option is correct because arrays in Java are objects.

Which of the following command options of aspnet_regiis is used to encryption config sections?

  1. –e

  2. –pe

  3. -enc

  4. All of the Above


Correct Option: B

Which character is used to continue a statement in SQL*Plus?

  1. *

  2. /

  3. -

  4. =


Correct Option: C

Which character function can be used to return a specified portion of a character string?

  1. INSTR

  2. SUBSTRING

  3. SUBSTR

  4. POS


Correct Option: C

The primary key on table EMP is the EMPNO column. Which of the following statements will not use the associated index on EMPNO?

  1. select * from EMP where nvl(EMPNO, '00000') = '59384';

  2. select * from EMP where EMPNO = '59384';

  3. select EMPNO, LASTNAME from EMP where EMPNO = '59384';

  4. select 1 from EMP where EMPNO = '59834';


Correct Option: A
Explanation:

To solve this question, the user needs to understand the concept of indexes and how they work. An index is a data structure that improves the speed of data retrieval operations on a database table. It is created on one or more columns of a table to allow faster search and retrieval of data based on the values stored in those columns.

Now, let's go through each option and determine whether or not it will use the associated index on EMPNO:

A. select * from EMP where nvl(EMPNO, '00000') = '59384';

This option will not use the associated index on EMPNO. The nvl function in the where clause of this query will cause a full table scan to be performed instead of using the index. This is because the function modifies the column value, making it impossible to use the index for a direct lookup.

B. select * from EMP where EMPNO = '59384';

This option will use the associated index on EMPNO. The query filters on the exact value of EMPNO, which makes it possible to use the index for a direct lookup.

C. select EMPNO, LASTNAME from EMP where EMPNO = '59384';

This option will use the associated index on EMPNO. The query filters on the exact value of EMPNO and only selects the EMPNO and LASTNAME columns, making it possible to use the index for a direct lookup and avoid accessing the table rows.

D. select 1 from EMP where EMPNO = '59834';

This option will use the associated index on EMPNO. The query filters on the exact value of EMPNO, and although it does not retrieve any column values, the index can still be used to perform the lookup and avoid the full table scan.

Therefore, the option that will not use the associated index on EMPNO is:

A. select * from EMP where nvl(EMPNO, '00000') = '59384';

The Answer is: A

In which one of the following scenairos the IMS status code AM will be issued

  1. The DLI call did specify a segment I/O area

  2. The function code field specified for the DLI call contains an incorrect value

  3. The DLI call attempted to perform an operation which is not authorised by processing option specified in the PCB

  4. The DLI call specifies an invalid SSA.


Correct Option: C

The process to assemble and link edit the macro instructions that specify an application programs view of one or more databases is called.

  1. PCBGEN

  2. PSBGEN

  3. DBDGEN

  4. ACBGEN


Correct Option: B

What tool should you recommend for a junior DBA to use to create a simple backup strategy for a SQL Server database?

  1. Database Engine Tuning Advisor

  2. SQL Server Configuration Manager

  3. Database Maintenance Plan Wizard

  4. Database Maintenance design surface


Correct Option: C

You have a 1TB SalesDB database running on SQL Server 2003 Enterprise Edition. You have noticed that the nightly DBCC CHECKDB ('SalesDB') job is starting to take too long, and you want to reduce the amount of time that the check will take. What command should you schedule to run nightly instead?

  1. DBCC CHECKDB ('SalesDB', REPAIR_ALLOW_DATA_LOSS)

  2. DBCC CHECKDB ('SalesDB', REPAIR_REBUILD)

  3. DBCC CHECKDB ('SalesDB') WITH PHYSICAL_ONLY

  4. DBCC CHECKDB ('SalesDB') WITH DATA_PURITY


Correct Option: C

You write a SQL Server stored procedure that will return data for a report. The accuracy of the data is not so important; however, you want to avoid dirty reads. Which isolation level should you avoid?

  1. Read Committed

  2. Read Uncommitted

  3. Repeatable Read

  4. Serializable


Correct Option: B

You want to identify the top 10 queries in SQL Server that have been recompiled the most times on your server. What can you do?

  1. Use the sys.dm_exec_requests dynamic management view.

  2. Use the sys.dm_exec_sessions dynamic management view

  3. Use the sys.dm_exec_query_stats dynamic management view

  4. Use the sys.dm_exec_query_optimizer_info dynamic management view


Correct Option: C

When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?

  1. System tablespace

  2. Users tablespace

  3. Default tablespace for the user

  4. Default tablespace for system


Correct Option: C

AI Explanation

To answer this question, we need to understand how Oracle manages the storage of segments.

When a user creates an object (such as a table or index) without specifying a TABLESPACE clause, Oracle will store the segment in the default tablespace for the user.

Option A) System tablespace - This option is incorrect because the system tablespace is used to store the data dictionary and other system-related objects, not user-created segments.

Option B) Users tablespace - This option is incorrect because there is no specific "users" tablespace in Oracle. Each user has their own default tablespace, which is where the segment would be stored.

Option C) Default tablespace for the user - This option is correct because Oracle will store the segment in the default tablespace for the user who created the object.

Option D) Default tablespace for system - This option is incorrect because there is no specific "default tablespace for system" in Oracle. The default tablespace is specific to each user.

The correct answer is Option C) Default tablespace for the user. This option is correct because Oracle will store the segment in the default tablespace for the user who created the object.

Assuming today is Monday, 10 July 2000, what is returned by this statement: SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual;

  1. 36724

  2. 36717

  3. 36719

  4. 36718


Correct Option: A
  1. Process control Block

  2. Program Control Block

  3. Program Communication Block

  4. Process Communication Block


Correct Option: C

If any higher-level segements is retrieved during IMS seqential retrieval it is indicated by which one of the following status code

  1. GA

  2. GD

  3. GK

  4. GB


Correct Option: A

Which one of the following status code indicates a duplicate insertion of a segment in IMS

  1. II

  2. AI

  3. IX

  4. AJ


Correct Option: A
- Hide questions