Valid PDI Dumps shared by ExamDiscuss.com for Helping Passing PDI Exam! ExamDiscuss.com now offer the newest PDI exam dumps, the ExamDiscuss.com PDI exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PDI dumps with Test Engine here:
A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Within the class, the developer identifies the following method as a security threat: ist<Contact> performSearch (String lastName} [return Database.query('SELECT Id, FirstName, LastName FROM Contact WHERE LastName Like s'+lastName+'s'")?; What are two ways the developer can update the method to prevent a SOQL injection attack? Choose 2 answers
Correct Answer: A,B
* Option A: Using variable binding eliminates the need for concatenating dynamic values in the query, which is the safest approach. * Option B: UsingString.escapeSingleQuotesensures special characters are handled safely, reducing the risk of SOQL injection. * Not Suitable: * Option C: Whilewith sharingensures sharing rules are applied, it does not prevent SOQL injection. * Option D: Regular expressions are not a reliable method for sanitizing input. :Preventing SOQL Injection