0

databases Online Quiz - 51

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

Which of the following denote the type of servlet?

  1. GenericServlet

  2. HttpServlet

  3. Both (A) and (B)

  4. None of the Above


Correct Option: C

AI Explanation

To answer this question, you need to understand the concepts of servlets in Java.

Option A) GenericServlet - This option is correct. GenericServlet is an abstract class that provides a generic implementation of the Servlet interface. It can handle any type of protocol and is protocol-independent.

Option B) HttpServlet - This option is correct. HttpServlet is a subclass of GenericServlet and provides specific implementation for handling HTTP requests. It is specifically designed for handling HTTP protocol requests and responses.

Option C) Both (A) and (B) - This option is correct. Both GenericServlet and HttpServlet are types of servlets. HttpServlet is a subclass of GenericServlet, so it inherits all the methods and functionality of GenericServlet.

Option D) None of the Above - This option is incorrect, as both GenericServlet and HttpServlet are types of servlets.

The correct answer is C) Both (A) and (B). This option is correct because both GenericServlet and HttpServlet are types of servlets in Java.

Consider the following piece of code byte x = 0; x += 1;

  1. Results in x having the value 1.

  2. Causes a compiler error.

  3. Will require a cast (byte) before 1.

  4. Will give syntax error.


Correct Option: A

What is the base type of the array given below? Color[] example = new Color[20];

  1. Color

  2. example

  3. No base type

  4. Both (A) and (B)


Correct Option: A

Protocols supported by WCF

  1. TCP

  2. Http

  3. MSMQ

  4. All of the Above


Correct Option: D
  1. The method must return a type of either IEnumerator or Ienumerable

  2. The method must return a type of IComparable

  3. The method must explicitly contain a collection

  4. A and B


Correct Option: A

Which of the following setting deny anonymous access to a Web application?

  1. A.

  2. B.

  3. C. < deny users=”*”/>

  4. D.


Correct Option: B

What is the initial contact point for handling a web request in a Page-Centric architecture?

  1. JSP Page

  2. Java bean

  3. Servlet

  4. Session manager


Correct Option: A

AI Explanation

To answer this question, you need to understand the basic components of a web application in a Page-Centric architecture.

In a Page-Centric architecture, the initial contact point for handling a web request is typically a JSP (JavaServer Pages) page.

Option A) JSP Page - This option is correct because a JSP page is responsible for generating the dynamic content that is sent back to the client in response to a web request.

Option B) Java bean - This option is incorrect because a Java bean is a reusable software component that is used to encapsulate data and provide methods to manipulate that data. While Java beans can be used in conjunction with JSP pages to process data, they are not the initial contact point for handling a web request.

Option C) Servlet - This option is incorrect because a servlet is a Java class that is responsible for processing web requests and generating dynamic content. While servlets play a crucial role in handling web requests, they are not the initial contact point in a Page-Centric architecture.

Option D) Session manager - This option is incorrect because a session manager is responsible for managing user sessions in a web application. While session management is an important aspect of a web application, it is not the initial contact point for handling a web request in a Page-Centric architecture.

The correct answer is A) JSP Page. This option is correct because a JSP page is where the initial handling of a web request occurs in a Page-Centric architecture.

Which one of the following function cannot be used with IMS database CALLs?

  1. GHU

  2. DELT

  3. ISRT

  4. CHNG


Correct Option: D

AI Explanation

To answer this question, you need to understand the functions that can be used with IMS database CALLs.

IMS (Information Management System) is a hierarchical database management system developed by IBM. It allows users to store and retrieve data in a hierarchical structure.

Let's go through each option to understand why it can or cannot be used with IMS database CALLs:

Option A) GHU - This option can be used with IMS database CALLs. GHU stands for Get Hold Unit, and it is used to retrieve a specified record from the database.

Option B) DELT - This option can be used with IMS database CALLs. DELT stands for Delete, and it is used to delete a specified record from the database.

Option C) ISRT - This option can be used with IMS database CALLs. ISRT stands for Insert, and it is used to insert a new record into the database.

Option D) CHNG - This option cannot be used with IMS database CALLs. CHNG is not a valid IMS database function. It is not a standard function provided by IMS.

Therefore, the correct answer is D) CHNG. This option cannot be used with IMS database CALLs because it is not a valid IMS database function.

What is the maximum no. of PCBs that can be defined in a PSB?

  1. 255

  2. 1000

  3. 256

  4. 15


Correct Option: A

Which one of the following DLI call statements is incorrect?

  1. CALL ‘CBLTDLI’ USING PARM-COUNT, FUNC-CODE, DB-PCB-MASK, IO-AREA, SSA-LIST.

  2. CALL ‘CBLTDLI’ USING FUNC-CODE, DB-PCB-MASK, IO-AREA.

  3. CALL ‘CBLTDLI’ USING FUNC-CODE, DB-PCB-MASK, SSA-LIST.

  4. CALL ‘CBLTDLI’ USING FUNC-CODE, DB-PCB-MASK, IO-AREA, SSA-LIST.


Correct Option: C

Command to execute a compiled java programs is

  1. run

  2. execute

  3. javac

  4. java


Correct Option: D

AI Explanation

To execute a compiled Java program, you need to use the java command.

The correct answer is D) java.

Explanation for each option:

Option A) run - This option is incorrect because "run" is not a valid command to execute a compiled Java program.

Option B) execute - This option is incorrect because "execute" is not a valid command to execute a compiled Java program.

Option C) javac - This option is incorrect because "javac" is used to compile Java source code, not to execute a compiled program.

Option D) java - This option is correct because the "java" command is used to execute a compiled Java program. You can run the program by typing java in the command line, where `` is the name of the compiled Java file without the ".class" extension.

How can you ensure that the memory allocated by an object is freed?

  1. By invoking the free method on the object

  2. By calling system.gc() method

  3. By setting all references to the object to new values (say null).

  4. Garbage collection cannot be forced. The programmer cannot force the JVM to free the memory used by an object.


Correct Option: D
Explanation:

The correct answer is D. Garbage collection cannot be forced. The programmer cannot force the JVM to free the memory used by an object. The JVM will automatically free the memory used by an object when it is no longer referenced by any other object.

Option A is incorrect because there is no free method in Java.

Option B is incorrect because calling system.gc() only requests the JVM to run the garbage collector, but it does not guarantee that the garbage collector will actually free the memory used by the object.

Option C is incorrect because setting all references to the object to new values (say null) will only prevent the JVM from garbage collecting the object, but it will not actually free the memory used by the object.

The memory used by an object will only be freed when the object is no longer referenced by any other object. This is the principle of garbage collection.

In order to use a servlet for handling the submission of a web form, subclass HttpServlet() and put service code in service() method

  1. doGet() or doPost() method

  2. getServletInfo() method

  3. All of the above

  4. none of the above


Correct Option: A

Which of the following denote the Mechanism for Session Tracking?

  1. cookies

  2. hidden form fields

  3. SSL sessions

  4. All of the above


Correct Option: D

Which one of the following statements about a IMS-DB2 BATCH DLI program is False?

  1. IMS act as the resource manager when DB2 program is invoked from IMS

  2. Commits and rollbacks are performed using COMMIT and ROLLBACK Commands

  3. DB2 can be invoked from IMS using IMS-DB2 attachment facility

  4. DB2 Subsystem and plan name are DSNMTV01 in DD


Correct Option: B

Which one of the following library type is used in DLI jobs to dynamically allocate database clusters?

  1. PSBLIB

  2. DBDLIB

  3. ACBLIB

  4. USERLIB


Correct Option: D

Which of the following is an important consideration when tuning an SQL statement?

  1. The number of CPUs on the server

  2. The degree of parallelism on the tables

  3. The use of bitmap indexes

  4. The quality of the SQL optimization


Correct Option: D

AI Explanation

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

A. The number of CPUs on the server - This option is incorrect because the number of CPUs on the server does not directly affect the tuning of an SQL statement. The number of CPUs may impact the overall performance of the database server, but it is not a specific consideration for tuning an individual SQL statement.

B. The degree of parallelism on the tables - This option is also incorrect because the degree of parallelism on the tables is not directly related to tuning an SQL statement. The degree of parallelism determines how many parallel processes can be used to execute a particular SQL operation, but it is not a consideration specific to tuning the statement itself.

C. The use of bitmap indexes - This option is incorrect as well because the use of bitmap indexes is a method of indexing data in a database, but it is not directly related to tuning an SQL statement. The choice of index type may impact the performance of queries, but it is not a primary consideration when tuning a specific SQL statement.

D. The quality of the SQL optimization - This option is correct because the quality of SQL optimization is an important consideration when tuning an SQL statement. SQL optimization involves analyzing the structure of the SQL statement, the underlying database schema, and the available indexes to generate an efficient execution plan. By optimizing the SQL statement, you can improve its performance and minimize resource usage.

Therefore, the correct answer is D. The quality of the SQL optimization. This option is correct because it is an important consideration when tuning an SQL statement.

Which of the following database design features is most important to SQL performance?

  1. Removal of data redundancy

  2. The introduction of data redundancy

  3. The introduction of non-first normal form relations

  4. The introduction of SQL*Plus


Correct Option: B

Why is searching for large-table full-table scans critical to SQL tuning?

  1. They indicate an optimized execution plan.

  2. They may be able to be tuned to use an index

  3. The full-table scan should be normalized from the database design

  4. A full-table scan is always sub-optimal.


Correct Option: B
Explanation:

To answer this question, the user needs to understand the basics of SQL tuning and database optimization.

The correct answer is:

B. They may be able to be tuned to use an index

Explanation:

A full-table scan is a process in which the database engine reads all the rows of a table to find the relevant data. This can be a time-consuming process, especially for large tables. Full-table scans are not always sub-optimal, but they can be inefficient if the table is not properly indexed. When a table is not indexed correctly, the database engine must read every row of the table to find the relevant data, even if only a small subset of the data is needed.

Therefore, searching for full-table scans is critical to SQL tuning because it allows a database administrator to identify tables that are not properly indexed. Once identified, the administrator can then tune the full-table scan to use an index, which can improve performance and reduce the time it takes to retrieve the data.

Option A is incorrect because a full-table scan does not indicate an optimized execution plan. It may be the only option available, but it is not necessarily optimized.

Option C is incorrect because a full-table scan is not something that should be normalized from the database design. It is a method of retrieving data from a table and can be optimized through proper indexing.

Option D is incorrect because a full-table scan is not always sub-optimal. It depends on the size of the table and how well it is indexed.

What best describes the relationship between indexes and SQL performance?

  1. Indexes are only used in special cases

  2. Indexes are used to make table storage more efficient

  3. Indexes rarely make a difference in SQL performance

  4. Indexes exist solely to improve query speed.


Correct Option: D
- Hide questions