Java: In Java, which comparison about JDBC and Prepared Statements is accurate?

Difficulty:

Easy

Questions:

1

Time Limit:

2 minutes

Passing Score:

100%

Question

In Java, which comparison about JDBC and Prepared Statements is accurate?

  1. They improve safety and often improve reuse compared with building SQL strings manually.
  2. There is no practical difference in behavior, performance, or API design when JDBC and Prepared Statements is involved.
  3. The oldest option related to JDBC and Prepared Statements is always the right production choice regardless of context.
  4. Differences around JDBC and Prepared Statements are mostly cosmetic, so correctness and maintainability do not change.

Hint

Focus on the behavior or tradeoff, not just the keyword.

Answer and rationale

Correct answer: A. They improve safety and often improve reuse compared with building SQL strings manually.

They improve safety and often improve reuse compared with building SQL strings manually. This is the comparison that usually separates memorization from understanding.

Track: Java