Exam 1z0-816 All QuestionsBrowse all questions from this exam
Question 34

Consider this method declaration:

A) “SET SESSION AUTHORIZATION “ + user

B) “SET SESSION AUTHORIZATION “ + stmt.enquoteIdentifier(user)

Is A or B the correct replacement for and why?

    Correct Answer: B

    B is the correct replacement because enquoting values provided by the calling code prevents SQL injection. SQL injection is a common web application vulnerability that occurs when an attacker is able to manipulate a query by injecting malicious input. Using stmt.enquoteIdentifier(user) ensures that the user input is appropriately treated as an identifier, preventing any malicious manipulation.

Discussion
Sa16253748596Option: B

B is true