Given the code fragment: What change should you make to apply good coding practices to
this fragment?
A.
Add nested try-with-resources statements for the statement and ResultSet declarations.
B.
Add the statement and ResultSet declarations to the try-with-resources statement.
C.
Add a finally clause after the catch clause.
D.
Rethrow SQLException.
Please explain why the answer C is supposed to be correct (marked as good answer) rather than the B.
correct answer is B
B.