Java: Which statement about JDBC and Prepared Statements is the strongest interview answer?

Difficulty:

Easy

Questions:

1

Time Limit:

2 minutes

Passing Score:

100%

Question

Which statement about JDBC and Prepared Statements is the strongest interview answer?

  1. JDBC and Prepared Statements is mostly a naming style choice and has little effect on runtime or design.
  2. JDBC and Prepared Statements exists mainly to reduce the number of Java files in a project.
  3. JDBC and Prepared Statements matters only for frontend frameworks, not for core Java applications.
  4. Prepared statements separate SQL structure from user-supplied parameter values.

Hint

Start with the core rule behind JDBC and Prepared Statements.

Answer and rationale

Correct answer: D. Prepared statements separate SQL structure from user-supplied parameter values.

Prepared statements separate SQL structure from user-supplied parameter values. This is the base concept interviewers commonly test first.

Track: Java