What statements are correct about positioned updates (i.e. cursor updates) in ResultSets? (2 answers)

  1. [_] [a] Using the cursor technique is currently the only possible way to change the data in the

  2. [_] [b] Insert statements are not supported when using cursors.

  3. [_] [c] Only scrollable updateable ResultSets can use this approach to change the data in the

  4. [_] [d] The name of the cursor is specified by the setCursorName(String name) method the


Correct Option: B,D

AI Explanation

To answer this question, we need to understand the concept of positioned updates in ResultSets.

Option A) Using the cursor technique is currently the only possible way to change the data in the ResultSets. This statement is incorrect. Positioned updates are one way to change the data in ResultSets, but they are not the only possible way. Other methods, such as using SQL update statements, can also be used to modify the data in ResultSets.

Option B) Insert statements are not supported when using cursors. This statement is correct. When using positioned updates (cursor updates) in ResultSets, insert statements are not supported. Positioned updates are primarily used for modifying existing data in the ResultSets, not for inserting new data.

Option C) Only scrollable updatable ResultSets can use this approach to change the data in the ResultSets. This statement is incorrect. Positioned updates can be used with both scrollable and forward-only ResultSets. Scrollable ResultSets allow for navigating through the ResultSet in both directions, while forward-only ResultSets only allow forward navigation.

Option D) The name of the cursor is specified by the setCursorName(String name) method. This statement is correct. The name of the cursor used for positioned updates can be specified using the setCursorName(String name) method. This allows for identifying and referencing the cursor when performing updates on the ResultSets.

Therefore, the correct statements about positioned updates in ResultSets are:

  • B) Insert statements are not supported when using cursors.
  • D) The name of the cursor is specified by the setCursorName(String name) method.

So, the correct answer is B, D.

Find more quizzes: