Searching for "exceptions"

Q:

What is the common usage of serialization? What exceptions occur during serialization?

Answer

The object need to be serialized when it’s sent over a network and when it’s state is saved. Exceptions which occur during serialization are:


a. transient fields


b. when the base class is serialized then only base class fields are handled.


c. static fields are ignored because they are not part of any state.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

Explain how PL/SQL exceptions are raised.

Answer

PL/SQL exceptions are raised using the RAISE command. This command is used when exceptions are defined by programmer and not implicit exceptions.


 


Example:


Declare and raising an exception:


DECLARE


short_of_attendance EXCEPTION;


min_attendance NUMBER(4);


BEGIN


...


IF min_attendance < 10 THEN


RAISE short_of_attendance;


END IF;


EXCEPTION


WHEN short_of_attendance THEN


-- handle the error


END;

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

Q:

Explain some of the commonly used Predefined PL/SQL Exceptions.

Answer

1)Divide by zero        – This is raised when any number is attempted to divide by zero.


2)TOO MANY ROWS   - A SELECT INTO statement returns more than one row.


3)CASE_NOT_FOUND - No choice in the WHEN clause of a case statement is selected.


4)LOGIN_DENIED      - An attempt to login with an invalid username or password.


5)PROGRAM_ERROR  - An internal PL/SQL problem.

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

Q:

What are PL/SQL cursor exceptions?

Answer

Cursor_Already_Open,  Invalid_Cursor.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

Name any three PL/SQL exceptions?

Answer

Too_many_rows.


No_Data_Found.


Zero_Error.


 

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

Where does the exceptions are used?

A) Exceptions are used when postconditions of a function cannot be satisfied. B) Exceptions are used when postconditions of a function can be satisfied.
C) To preserve the program D) none of these
 
Answer & Explanation Answer: B) Exceptions are used when postconditions of a function can be satisfied.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

Q:

How do define the user-defined exceptions?

A) inheriting and overriding exception class functionality. B) overriding class functioality.
C) inheriting class functionality D) none of the mentioned
 
Answer & Explanation Answer: A) inheriting and overriding exception class functionality.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++