Multiple choice technology security

"SELECT name FROM users WHERE id = " + form.getUserID()"; Using TCS SAPI what is the best way to remediate the SQL injection vulnerability in the above query to an Oracle Database?

  1. "SELECT name FROM users WHERE id = " + com.tcs.sapi.io.ValidationUtil.encodeForOraSQL(validatedUserId);

  2. "SELECT name FROM users WHERE id = " + com.tcs.sapi.io.ValidationUtil.encodeForSQL(validatedUserId);

  3. "SELECT name FROM users WHERE id = " + com.tcs.sapi.io.ValidationUtil.encodeForSQL( new Codec(), validatedUserId);

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Oracle databases have specific SQL syntax requirements, so encodeForOraSQL is the correct encoder that handles Oracle-specific escaping (like handling quotes, special characters in Oracle SQL). Generic encodeForSQL might not account for Oracle's unique syntax. Option C is incorrect because ValidationUtil methods are static and don't require a Codec object parameter.